I'm really stressed right now, and need some help.
I've just embedded my style into my dologin.php, which checks if you have logged in successfully. If you made an error, such as wrong username, or wrong password, it will kill the rest of the page. If you logged in successfully, it will continue on, and start the session, thus unlocking some of the features of the site. In theory.
Here's an example of what I have so far (correctly corresponding to my current one):
<?php session_start(); ?>
<html>
<body>
<!-- Page Markup Content -->
<?php
$name = $_POST['name'];
$password = $_POST['password'];
if ($name&&$password)
{
$connect = mysql_connect("***", "****", "**********") or die("Couldn't connect");
mysql_select_db("****") or die("Couldn't connect");
$query = mysql_query("SELECT * FROM members WHERE name='$name'");
if ($name==$correctuser&&$password==$correctpassword)
{
echo "Success";
$_SESSION['session']=$session;
}
else
echo "Incorrect password";
}
else
die("That user doesn't exist");
}
else
die("Please enter a username or password");
?>
<!-- CONTINUING WITH THE PAGE CONTENT (Footers, etc) -->
</body>
</html>
Please disregard all the errors in that code, it was just something written up for an example of what I'm using
Now, if the user has correctly typed in their information, and it succeeds, it will display "success" and show the rest of the content.
If the information is wrong, it will die and kill everything.
Is there an alternative to where they can type in the wrong ****, and still have an error, but the rest of the page will show?
Edited by AtomSai, 06 October 2010 - 03:51 PM.


Sign In
Create Account

Back to top









