PHP newbie - question about variables
Posted: Fri Jul 14, 2006 10:20 am
Hi,
I'm just starting on PHP and I have a problem passing a variable.
Here is the code that is not working for me.
The testvar.php page has the following code
I'm trying to get the output from the echo to be test, but at the moment all that is being outputted is $selected
Am I missing something obvious?
Thanks,
I'm just starting on PHP and I have a problem passing a variable.
Here is the code that is not working for me.
Code: Select all
$selected = "test";
<a href=testvar.php?passedvar=$selected><img src="gifs/go.gif" alt="" name="" width="30" height="20" border="0"></a>The testvar.php page has the following code
Code: Select all
<?php
echo $_GET['passedvar'];
?>Am I missing something obvious?
Thanks,