![]() |
|
[PHP] PHP Login Problem (Masters in PHP) - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Web Development (https://hackforums.net/forumdisplay.php?fid=183) +---- Thread: [PHP] PHP Login Problem (Masters in PHP) (/showthread.php?tid=2688954) |
PHP Login Problem (Masters in PHP) - Dark Angels - Jul 17, 2012 Hey guys, okay I have a problem with PHP $_POST. The problem is I have a login.php page where I want a particular username and password will work on it and redirect to a member-index.php page. And, if the particular username and password is not there it will redirect them to incorrect.php I came up with this though, Code $login = "james"; Here is the main login portal Code <form action="login-exec.php" name="login" method="post" id="loginform">Thanks for any reply * - +iPokemon - Jul 17, 2012 (Jul 17, 2012 07:17 PM)Dark Angels Wrote: Hey guys, okay I have a problem with PHP $_POST. When you're echoing your "redirects", use PHP Code not document.location. That's javascript. And you're not getting the values from the form. You're just checking to see if $login = $login (true) and $pass = $pass (true). Your code is being redundant and not even checking what has been submitted in the form. * - m0rTonB3LL - Jul 17, 2012 Here's the completely working code.... with some improvements. PHP Code * - ankitagrawal - Apr 22, 2017 PHP Code * - taz3r - Apr 22, 2017 (Apr 22, 2017 05:08 AM)ankitagrawal Wrote: Why set the $login and $password variable? I thought he was submitting it via $_POST |