Cookie question
Posted: Mon Dec 01, 2003 10:21 am
Quick question. Just moved to a new host, this script worked on my old server but now it's not:
Basically what's happening is that the cookie isn't setting. It worked fine on my old server but not now, am I doing something wrong? The Apache and PHP versions are the same, the only difference is that this new host uses mySQL 4x while the old one used 3x, I don't know if that makes a difference or not. Please let me know if I'm too vague and you need more information, thanks!
Code: Select all
<?php
mysql_connect('*****', '*****, '*****');
mysql_select_db('*****');
$username = $_POSTї'login'];
$password = $_POSTї'password'];
$query = mysql_query("SELECT * FROM users WHERE username = '$username' AND password = '$password'");
if (mysql_num_rows($query) > 0) {
setcookie ('guildname', $username, "31104000", "/");
include 'welcome.php';
}
else {
include 'failed.php';
}
mysql_close();
?>Basically what's happening is that the cookie isn't setting. It worked fine on my old server but not now, am I doing something wrong? The Apache and PHP versions are the same, the only difference is that this new host uses mySQL 4x while the old one used 3x, I don't know if that makes a difference or not. Please let me know if I'm too vague and you need more information, thanks!