Well, what do I mean by a dynamic cookie?
Well the cookie name is dependant on what the site title is, which is looked up in a MySQL table and stored in $config_site, which is easy to understand.
To compare the infomation sent by a from (e.g when logging on) with a user within a database is quite straight-forward.
Code: Select all
$login_link = mysql_query("SELECT * FROM `$mysql_user` WHERE 1 AND `username` = '$_POSTїusername]' AND `password` = '$_POSTїpassword]' LIMIT 0, 1",$db);Code: Select all
$user_link = mysql_query("SELECT * FROM `$mysql_user` WHERE 1 AND `username` = '$_COOKIEї$config_title.'їusername]']' AND `password` = '$_COOKIEї$config_title.'їpassword]']' LIMIT 0, 1",$db);So I looked in the MySQL manual and you can use double quotes to indicate the start of a new quote opening like this ->
Code: Select all
$user_link = mysql_query("SELECT * FROM `$mysql_user` WHERE 1 AND `username` = '$_COOKIEї$config_title.''їusername]'']' AND `password` = '$_COOKIEї$config_title.''їpassword]'']' LIMIT 0, 1",$db);I know I'm doing something wrong, can anyone help?