![]() |
Cant extract info from cookie
Hey,
My forums are located in a directory and not a subdomain: http://www.domain/forums I need to use the username and password from the cookie, in other areas of my website, so I changed the name of the cookie to: .domain.com Searched the forums and found some code (used for extracting data from the cookie). I modified it a little, so it fit my needs: //Select the forum database mysql_select_db ("perfume_forums"); $userid = intval($_COOKIE[bbuserid]); $password = addslashes($_COOKIE[bbpassword]); $result = mysql_query("SELECT username, userid FROM user WHERE userid=$userid AND MD5(CONCAT(password, 'LicenseNo')) = '$password'"); $user = mysql_fetch_array($result); if ($user[userid]) { //echo "<input name='user_name' type='hidden' value='$user[userid]'>"; echo "User: ".$user[username]; } else { echo "<input name='user_name' type='text' class='rating-form' maxlength='20'>"; } - why doent this work? |
anyone? Shouldnt it work?
|
Can anyone see a error in this:
$userid = intval($_COOKIE[bbuserid]); $password = addslashes($_COOKIE[bbpassword]); $result = mysql_query("SELECT username, userid FROM user WHERE userid=$userid AND MD5(CONCAT(password, 'LicenseNo')) = '$password'"); $user = mysql_fetch_array($result); if ($user[usernmae]) { echo "bla bla"; }else{ echo "no bla bla"; } - If I replace $user[username] with $userid or $password, then it echo "bla bla" |
you forgot the salting
look at login.php around line 139 to see how vb's passwords are build |
it is working now :)
|
All times are GMT. The time now is 08:13 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|