PDA

View Full Version : [ubuntu] pass php variable in an anchor tag



subhojit
February 3rd, 2012, 05:13 AM
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...

richardjh
February 3rd, 2012, 02:29 PM
Your php should be within the double quoted href. It should read as


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

subhojit
February 3rd, 2012, 03:52 PM
Your php should be within the double quoted href. It should read as


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

thanks buddy