login help php newbie

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
james7801
Forum Newbie
Posts: 5
Joined: Sun Jan 04, 2009 3:32 pm

login help php newbie

Post by james7801 »

hello all

Im creating a website that will have many users logings containing; stats, offer, etc

I have the login complete from this tut http://www.phpeasystep.com/workshopview.php?id=6

however

I would like it so if the user supplies a wrong password or username they stay on the same page and I would like to output my own message

instead of moving to a login_check.php page
<form name="form1" method="post" action="login_check.php">

which contains all the database connections and
username/password checking

i was thinking of something like
{
$loginerror = "Wrong Username or Password";
header("location:login.php");
}
on the checking page

then on the login.php
<?php
echo "$loginerror";
?>

but this dont work and i guess that if you failed to login once the message would display each time you go to the same page


please help lol
User avatar
it2051229
Forum Contributor
Posts: 312
Joined: Tue Dec 25, 2007 8:34 pm

Re: login help php newbie

Post by it2051229 »

you can do that by calling the SAME PAGE (on the FORM tag) on the login php file and also do the validation on the SAME PAGE.
Post Reply