Forum Moderators: coopster
function testCode($type,$username){
#Open database connection
$this->dbConnection();
# Security
$type = mysql_real_escape_string($type);
$username = mysql_real_escape_string($username);
# Perfom database connection
$query = mysql_query("SELECT * FROM account WHERE username = '$username' AND type = '$type'") or die (mysql_error());
$getHaveFun = $query['have_fun'];
if (empty ($getHaveFun) ){
header("Location:http://www.doamin.com/haveFunSetup");
}else{
if ($getHaveFun == 'male'){
$getMaleFunType = $query['getMaleFunType'];
header("Location:http://www.domain.com/havefun/male/".$getMaleFunType);
}else{
$getFemaleFunType == $query['getFemaleFunType'];
header("Location:http://www.domain.com/havefun/female".$getFemaleFunType);
}
}
mysql_close($this->con);
} function testCode($type,$username){
#Open database connection
$this->dbConnection();
# Security
$type = mysql_real_escape_string($type);
$username = mysql_real_escape_string($username);
# Perfom database connection
$query = mysql_query("SELECT * FROM account WHERE username = '$username' AND type = '$type'") or die (mysql_error());
$getHaveFun = $query['have_fun'];
if (empty ($getHaveFun) ){
mysql_close($this->con);
header("Location:http://www.doamin.com/haveFunSetup");
die();
}else{
if ($getHaveFun == 'male'){
$getMaleFunType = $query['getMaleFunType'];
mysql_close($this->con);
header("Location:http://www.domain.com/havefun/male/".$getMaleFunType);
die();
}else{
$getFemaleFunType == $query['getFemaleFunType'];
mysql_close($this->con);
header("Location:http://www.domain.com/havefun/female".$getFemaleFunType);
die();
}
}
mysql_close($this->con);
}
Note: The link to the server will be closed as soon as the execution of the script ends, unless it's closed earlier by explicitly calling mysql_close().