gazalec Posted March 9, 2007 Share Posted March 9, 2007 I dont know why this script isn't working and i was wondering if anyone could help login.php <html> <head> <title> Login Page </title> </head> <body> <!-- Layout HTML--> <form action='login2.php' method='post'> Customer Number : <input type='text' name='cust'> <input type='submit' value='Login'> <input type='reset' value='Canel'> </form> </body> </html> login2.php <? session_start(); $cust = $_POST['cust']; $_SESSION['session_cust'] = $cust; header("Location:welcome.php"); ?> welcome.php <? session_start(); $_SESSION['session_cust']; if($_SESSION['session_cust'] == ''){ $_SESSION['session_cust] == 'Guest'; } ?> <!-- HTML PAGE --> <? if($_SESSION['session_cust']=='Guest'){ echo "Welcome Guest"; }else{ <!-- ACCESS DATABASE, RETREIVE CUSTOMER NAME --> echo "Welcome ".$name; } ?> The problem that is happening is no matter what it says Guest Link to comment https://forums.phpfreaks.com/topic/41958-problem-with-guest-customer-script/ Share on other sites More sharing options...
gazalec Posted March 9, 2007 Author Share Posted March 9, 2007 i found the problem it was in some of the if statements i was using = (equals) instead of == (equal to) Link to comment https://forums.phpfreaks.com/topic/41958-problem-with-guest-customer-script/#findComment-203443 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.