Jump to content

PHP login or redirect?


wut

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/261128-php-login-or-redirect/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.