By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,830 Members | 2,276 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,830 IT Pros & Developers. It's quick & easy.

Link

P: 65
Hi friends,
Is it possible to link the same page with in itself using '<a>' tag?
what i'm asking is if i'm creating a login form, when i run it and i mistype the pwd, it shows "Plz, Try again, Wrong Password",
then how can i go to the back page?
If i'm giving like the following, it doesn't works:

code:(php)
(login.php)

if ($_POST['pass'] != $info['password'])
{
echo 'Incorrect password, please try again.';
echo "<a href="login.php"> Go Back </a>"; //This shows me error
}

Plz....Help me..!!!

Thanx n regards.
Feb 14 '08 #1
Share this Question
Share on Google+
3 Replies


harshmaul
Expert 100+
P: 490
Hi friends,
if ($_POST['pass'] != $info['password'])
{
echo 'Incorrect password, please try again.';
echo "<a href="login.php"> Go Back </a>"; //This shows me error
}

Plz....Help me..!!!
Thanx n regards.
Two solutions... firstly you can use the escape charachter....

Expand|Select|Wrap|Line Numbers
  1. if ($_POST['pass'] != $info['password'])
  2.    {
  3.     echo 'Incorrect password, please try again.';
  4.     echo "<a href=\"login.php\"> Go Back </a>"; //This shows me error
  5.    }
Or you can do it like this....


Expand|Select|Wrap|Line Numbers
  1. if ($_POST['pass'] != $info['password'])
  2.    {
  3.     ?>
  4.      Incorrect password, please try again.
  5.     <a href="login.php"> Go Back </a>
  6.    <?php
  7.    }
Hope they help :)
Feb 14 '08 #2

P: 65
Two solutions... firstly you can use the escape charachter....
Expand|Select|Wrap|Line Numbers
  1. if ($_POST['pass'] != $info['password'])
  2.    {
  3.     ?>
  4.      Incorrect password, please try again.
  5.     <a href="login.php"> Go Back </a>
  6.    <?php
  7.    }
Hope they help :)
Yah! Its working..........
Thanx harshmaul....
Feb 14 '08 #3

harshmaul
Expert 100+
P: 490
No problems. Glad i could help!
Feb 14 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.