Jump to content

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


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!

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.