php href quotes etc......

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
bob302
Forum Newbie
Posts: 7
Joined: Sat Dec 18, 2010 7:01 pm

php href quotes etc......

Post 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.
User avatar
Jonah Bron
DevNet Master
Posts: 2764
Joined: Thu Mar 15, 2007 6:28 pm
Location: Redding, California

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

Post 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 ":")
bob302
Forum Newbie
Posts: 7
Joined: Sat Dec 18, 2010 7:01 pm

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

Post by bob302 »

Jonah
sorry for late reply it worked perfecftly thaks for the help!
Post Reply