|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
php script login problem -- please help!
members.php:
<?php if (!isset($_COOKIE['loggedin'])) die("You are not logged in! Please <a href=login.html> login </a>"); $mysite_username = $HTTP_COOKIE_VARS["mysite_username"]; echo "you are logged in as $mysite_username.<p>"; ?> I always get the "you are not logged" in message. Here is the code that processes the login. I have no problem matching the username with the password but somehow isset is always returning 0 in members.php setcookie("loggedin", "TRUE", time()+(3600 * 24)); setcookie("mysite_username", "$username"); echo "You are now logged in!<br>"; echo "Continue to the <a href=members.php>members</a> section."; Thanks in advance, Anand |
|
#2
|
|||
|
|||
|
Personally I would say use sessions, see the documentation on start_session unless you have specific reasons for using cookies.
Do you get any warnings, such as errors setting the cookie? Is your browser enabling cookies from your website (a privacy setting for most browsers) |
![]() |
| Viewing: Dev Articles Community Forums > Programming > PHP Development > php script login problem -- please help! |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|