Link

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • yasmine
    New Member
    • Feb 2008
    • 64

    Link

    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.
  • harshmaul
    Recognized Expert Contributor
    • Jul 2007
    • 490

    #2
    Originally posted by yasmine
    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....

    Code:
    if ($_POST['pass'] != $info['password'])
       {
        echo 'Incorrect password, please try again.';
        echo "<a href=\"login.php\"> Go Back </a>"; //This shows me error
       }
    Or you can do it like this....


    Code:
    if ($_POST['pass'] != $info['password'])
       {
        ?>
         Incorrect password, please try again.
        <a href="login.php"> Go Back </a>
       <?php
       }
    Hope they help :)

    Comment

    • yasmine
      New Member
      • Feb 2008
      • 64

      #3
      Originally posted by harshmaul
      Two solutions... firstly you can use the escape charachter....
      Code:
      if ($_POST['pass'] != $info['password'])
         {
          ?>
           Incorrect password, please try again.
          <a href="login.php"> Go Back </a>
         <?php
         }
      Hope they help :)
      Yah! Its working........ ..
      Thanx harshmaul....

      Comment

      • harshmaul
        Recognized Expert Contributor
        • Jul 2007
        • 490

        #4
        No problems. Glad i could help!

        Comment

        Working...