ok everything works on here
but when it sets the cookies
and i check in firefox i dont see them
the path for the script is thepappy.com/simusoft/login.php
i know this code works cause i use it on another site but different server
so anything you guys can suggest to fix will be much appricated
(also i know my sql info is blank i removed it to display on here)
<?php
session_start();
function clean($input) {
$input = strip_tags($input);
$input = str_replace("<","",$input);
$input = str_replace(">","",$input);
$input = str_replace("'","",$input);
$input = str_replace('"','',$input);
$input = str_replace(";","",$input);
$input = str_replace("script","",$input);
$input = str_replace("%3c","",$input);
$input = str_replace("%3e","",$input);
$input = str_replace("=", "", $input);
$input = str_replace("-", "", $input);
$input = str_replace(",", "", $input);
$input = str_replace("/", "", $input);
$input = str_replace("+", "", $input);
$input = str_replace("*", "", $input);
$input = str_replace("`", "", $input);
$input = str_replace("'", "", $input);
$input = str_replace("_", "", $input);
$input = str_replace("&", "", $input);
$input = str_replace("&&", "", $input);
$input = str_replace("[", "", $input);
$input = str_replace("]", "", $input);
$input = str_replace("{", "", $input);
$input = str_replace("}", "", $input);
$input = str_replace("%", "", $input);
$input = str_replace("^", "", $input);
$input = str_replace("|", "", $input);
$input = str_replace("~", "", $input);
$input = str_replace("#", "", $input);
$input = str_replace(":", "", $input);
$input = str_replace("?", "", $input);
$input = str_replace("@", "", $input);
$input = str_replace("(", "", $input);
$input = str_replace(")", "", $input);
$input = htmlspecialchars($input);
$input = trim($input);
return $input;
}
//Take form login details and clean them
if(isset($_POST['user'])){
$user = clean($_POST['user']);
echo $user;
echo "<br>";
}
if(isset($_POST['pass'])){
$pass = clean($_POST['pass']);
echo $pass;
echo "<br>";
}
if(isset($_POST['remember'])){
$remember = clean($_POST['remember']);
echo $remember;
echo "<br>";
}
//if user field is blank or password field is blank tell em to try again
if (!$user || !$pass) {
print "Please fill out all fields.";
exit;
}
mysql_pconnect();
mysql_select_db();
//take password and encrypt for sql comparison
$pass = md5($pass);
$logresq = mysql_query("select * from simusoft_players where usrname = \"$user\" AND usrpass = \"$pass\"");
$logres = mysql_num_rows($logresq);
echo mysql_error();
$logresa=mysql_fetch_array($logresq);
//if failed tell em so
if ($logres <= 0) {
print "Login failed.";
exit;
} else {
//if didnt fail, must be a suncess
$userid=$logresa['uid'];
//if they want to be remembered, set a cookie so they can stay
if($remember == "on"){ //Remember Me!!!
setcookie("sim_uid",$userid,mktime(date("H"), date("i"), date("s"), date("m"), date("d"), date("Y")+1),"/simusoft/","thepappy.com");
setcookie("sim_pw",$pass,mktime(date("H"), date("i"), date("s"), date("m"), date("d"), date("Y")+1),"/simusoft/",".thepappy.com");
}
//set the session details
session_regenerate_id();
session_register("userid");
session_register("pass");
// if they havent chosen a side redirect them to pick from vamp, daemon or other
if($logresa['class'] == ""){
header("Location: chooseclass.php");
}else{
header("Location: main.php");
}
}
?>