Jump to content

Help with login page / sessions


acroporas

Recommended Posts

Can you see what's up with this?

Even when I enter the correct username and password, the script does not jump pass the form.

[code]<?php

session_start();

if ( $POST['login'] == "iamme" && $_post['pasword'] == "saysme" )
$_SESSION['logged'] = "yes";


if ( $_SESSION['logged'] != "yes" )
{
?>

<html>
<head>
<title>Login</title>
</head>

<body>

<form action="index.php" method="post" >

  <p style="margin-top: 0; margin-bottom: 0"><b><font size="4">Domain.com</font></b></p>
  <p style="margin-top: 0; margin-bottom: 0">Login in to access admin page.</p>
 
<?php

if ( ( $_POST["login"] != "iamme" && $_POST["login"] ) || ( $_POST["pasword"] != "saysme" && $_POST["pasword"] ) )
echo '<p style="margin-top: 0; margin-bottom: 0">Username or password was incorrectly entered.</p>';
?>

  <p>&nbsp;</p>
 
  Login:    <input type="text" name="login" size="20"></p>
 
  Password:  <input type="password" name="pasword" size="20"></p>
 
  <p>&nbsp;</p>
 
  <p><input type="submit"></p>
</form>

</body>

</html>

<?php

die("");

}
?>
password was good.
[/code]
Link to comment
Share on other sites

[quote author=Gaoshan link=topic=110039.msg444105#msg444105 date=1159592764]
By "jump pass the form" do you mean you want the form to load some other page and it doesn't or do you want the form to reload the same page and it doesn't? Not clear what you want to do.  ???
[/quote]

overview of code

If ( $_session['login']!=yes )
{
display login page
submit goes back to same page
}
else

"password was good"

The problem is that even when the password is good, it still shows the login page.
Link to comment
Share on other sites

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.