Jump to content

Problem with Guest/ Customer Script


gazalec

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.