wut Posted April 17, 2012 Share Posted April 17, 2012 I'm trying to make a login page called login.html, currently my check.php posts from a submit button then checks the username and password fields. if (mysql_num_rows($res)==0) { echo "Username or password is incorrect <br>"; echo 'Click <a href="login.html">here</a> to try again'; } else { echo "Your Username and Password is correct, welcome<br>"; echo 'To enter the members area, click <a href="users.html">here</a> to enter'; } If the username or password is incorrect the site goes from login.html to check.php page and displays as expected: Username or password is incorrect Click here to try again Ideally, what I would like to happen would be the login.html page would let the user know that the username or password was incorrect. In a similar way to how https://www.stumbleupon.com/login does it. Or just an easier way to just replace the php code to redirect the user to a page like login_incorrect.html or something similar? I have tried simply copying the login.html code and putting it in a page called login.php and then adding the check.php code to this too, although this works I dont really want users to be able to see the code when going to the page source of login.php Thanks in advance Quote Link to comment Share on other sites More sharing options...
litebearer Posted April 17, 2012 Share Posted April 17, 2012 if your system is running php correctly (odds are it is), and you have written your code properly, then people cannot 'see' your php code, so no worries. To test it run your login.php and view the source. Quote Link to comment Share on other sites More sharing options...
wut Posted April 17, 2012 Author Share Posted April 17, 2012 Ahh thank you! Silly me, I really should of tried that and not just assumed it would be in the source! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.