Results 1 to 3 of 3

Thread: pass php variable in an anchor tag

  1. #1
    Join Date
    Jan 2012
    Beans
    27

    Exclamation pass php variable in an anchor tag

    hello, i have written a code like this:

    <a href="EditPage.php?id="<?php echo $UserId; ?>><input type="button" value="Edit account" /></a>

    its cleat that i am trying to pass the php variable UserId using GET method, but its not working. am i doing any error or is there any other way to do this. help, please...

  2. #2
    Join Date
    Aug 2009
    Location
    West Sussex, England
    Beans
    117
    Distro
    Ubuntu

    Re: pass php variable in an anchor tag

    Your php should be within the double quoted href. It should read as

    Code:
    <a href="EditPage.php?id=<?php echo $UserId; ?>" ><input type="button" value="Edit account" /></a>
    Richard Holloway
    PHP Developer and System Administrator
    http://richardjh.org

  3. #3
    Join Date
    Jan 2012
    Beans
    27

    Re: pass php variable in an anchor tag

    Quote Originally Posted by richardjh View Post
    Your php should be within the double quoted href. It should read as

    Code:
    <a href="EditPage.php?id=<?php echo $UserId; ?>" ><input type="button" value="Edit account" /></a>
    thanks buddy

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •