php in my html link doesn't work
Posted: Sat Apr 25, 2009 3:02 pm
Hi everyone, I am trying to echo a variable within a plain html link, but it doesn't work. My link looks like this:
I know that php is running because when I use this on it's own:
it displays the value of my variable $var, but it doesn't work in my link. I am new to php, and I have a feeling that there is some setting on my Apache Linux server that is set incorrectly. Perhaps in my setup file. You can see my php setup here - http://www.stephenpanderson.com/phpinfo.php
When I mouseover the link I see the link containing the php code unprocessed. I should be seeing the value instead.
when I view the source of my page the end of my link looks like this:
Any help would be very appreciated. I am a beginner with php.
Thanks,
Steve
Code: Select all
<a href="xxxxxxx.myurl.net/?tid=<?php echo $var; ?>">some text here</a>Code: Select all
<?php echo $var; ?>When I mouseover the link I see the link containing the php code unprocessed. I should be seeing the value instead.
when I view the source of my page the end of my link looks like this:
Code: Select all
.net/?tid=%3C?php%20echo%20$var;%20?%3EThanks,
Steve