Jump to content

I am having trouble with sessions? Getting a error. Help!


Alex1646

Recommended Posts

I get this errr message

Notice: Undefined index: user in C:\wamp\www\Login\login.php on line 25

Here is line 25:

$_SESSION['user'] == $form_username ;

Here is the whole page.

<?php session_start();

?> 
<html>
<head>
<title>Login</title>
<?php include('logic.inc'); ?>
</head>

<body>
<?php
if (!isset($_POST['user_name']) && isset($_POST['password']))  
{
die("Please enter both a username and password");
}
$form_username = $_POST['user_name'];
$form_password = $_POST['password'];
mysqlConnect();
loginvar();

if($passdb = $form_password && $userdb = $form_username)

{

$_SESSION['user'] == $form_username ;
echo "<hr />";
echo "Login Sucssesful <br /> ";
echo '<a href="/login/index.php">Return Home</a>';
}
else 
{
die("User name does not match password");
}


?>
</body>
</html>

Hellp!

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.