Quote marks in PHP

bigcougar

New Member
I am generating a table in PHP that should have a reference to a JavaScript function. This is the line in question:

PHP:
        echo "<td><a href:'javascript:GetFlyPic('".$row[F_Name]."')'>$row[F_Name]</a></td>";

The line above does not work, since the href in HTML should read:
href:"javascript:GetFlyPic('string')"

and not

href:'javascript:GetFlyPic('string')'

What is the solution to this terrible problem?: :confused:
 

bcee

New Member
PHP isn't my best but give this a go:

echo "<td><a href:'javascript:GetFlyPic('\"".$row[F_Name]."\"')'>$row[F_Name]</a></td>";
 

bigcougar

New Member
After many unsuccessful attempts I found out the problem was with href: which was supposed to be href=. Of course I had to use the escape character "\" in a couple of spots as well
 
Top