Code: Select all
<?php
ob_start();
include 'decl.php';
$user_session; //Is session exist
//Connection Info for databse
$con_host = "localhost";
$con_user = "root";
$con_pass = "google123";
$con_data = "pmv_data";
$user_db = "pmv_users";
mysql_connect("$con_host", "$con_user", "$con_pass") or die("can not connect to db");
mysql_select_db("$con_data") or die("Can not connect to table");
$user_name = $_POST['xuser_name'];
$user_pass = $_POST['xuser_pass'];
$user_name = stripslashes($user_name);
$user_pass = stripslashes($user_pass);
$user_name = mysql_escape_string($user_name);
$user_pass = mysql_escape_string($user_pass);
$sql = "SELECT * FROM $user_db WHERE user_username='.$user_name.' and user_password='.$user_pass.'";
$result = mysql_query($sql);
$count = mysql_num_rows($result);
if ($count == 1) {
$keep_user = $user_name;
setcookie("pmv_user", $_POST['xuser_name'], time() + 60 * 60 * 24 * 100, '/', 'www.pmvbid.com');
setcookie("pmv_userp", $_POST['xuser_pass'], time() + 60 * 60 * 24 * 100, '/', 'www.pmvbid.com');
} else {
setcookie('pmv_user', $user_name, FALSE, '/', 'www.pmvbid.com');
setcookie('pmv_userp', $user_name, FALSE, '/', 'www.pmvbid.com');
}
//header("location:../log.php");
print_r($_COOKIE);
ob_end_flush();
?>
Yes i know i have the redirect commented off that was so i can see if it is being written.
When it print_r the cookies i get this message
Array ( [pmv_user] => user_name [pmv_userp] => user_pass [PHPSESSID] => ri87h9h590dj40snal7asnn1f1 )
To me that is just putting user_name as user_name and user_pass as user_pass into the cookie but that's not right. Any Idea of why this is happening.
and cookies are enabled on all my browsers , Netscape, FF, IE, Chrome, and Safari.