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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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