Page 1 of 1

Passing variables through URL

Posted: Mon Sep 26, 2011 7:45 pm
by DomC
Hi,
For some reason this code:
<a href="managecomments.php?delete=<?php $stat['id'] ?>">
When clicked on goes to "managecomments.php?delete=" rather than including the id, for example "managecomments.php?delete=1"
Do you know why this is occurring?

Thanks for any help you can give!
Dom

P.s. Sorry if this is in the wrong section - I wasn't sure

Re: Passing variables through URL

Posted: Mon Sep 26, 2011 8:05 pm
by bowersbros
you need to echo that variable.

Re: Passing variables through URL

Posted: Mon Sep 26, 2011 8:28 pm
by DomC
Silly error on my part :(
Thanks a lot for your help!

Re: Passing variables through URL

Posted: Tue Sep 27, 2011 1:09 am
by JelvinJS7
Echo it out, and put a ; after $stat['id']

Re: Passing variables through URL

Posted: Tue Sep 27, 2011 3:14 pm
by jacek
JelvinJS7 wrote:Echo it out, and put a ; after $stat['id']
The last ; before the ?> is optional, but yeah it should be put there for consistency :)