PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
<?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!
Most likely a newer server. Or just a differently configured server. That's why it's best to code keeping in mind that it should work on all platforms and with all (or atleast most) setting types.