Page 1 of 1

php href quotes etc......

Posted: Sat Dec 18, 2010 7:11 pm
by bob302
Hello all,
I am a newbie and am going crazy attempting to get an echo statement working in php.
First the statement: echo "<a href=\"javascript:popUpFAQ('faq-1.htm'\">$player</a>";
This will not function.
It is the echo statement for a <td> where I wish to display a player's name in a column. The href is so the viewer can click on the name and see a pop-up showling his profile.
The code works in html with just a name in place of $player.
It works as is only the the url is carried causing error conditions in the pop-up.
Any help greatly appreciated.
Thanks in advance.

Re: php href quotes etc......

Posted: Sat Dec 18, 2010 7:22 pm
by Jonah Bron
You didn't finish the Javascript code in the href (missing ); at the end).

Code: Select all

echo "<a href=\"javascript : popUpFAQ('faq-1.htm');\">$player</a>";
(remove the space between "javascript" and ":")

Re: php href quotes etc......

Posted: Tue Dec 28, 2010 6:56 pm
by bob302
Jonah
sorry for late reply it worked perfecftly thaks for the help!