Web Design Forum  
 
Go Back   Web Design Forum > Web Software > Programming

Reply
 
LinkBack Thread Tools Display Modes
Old 11-03-2010, 06:01 PM   #1
Bronze Member
 
Join Date: Jul 2010
Posts: 45
Default Quote marks in PHP

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

PHP Code:
        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?:
bigcougar is offline   Reply With Quote


Old 11-04-2010, 01:51 AM   #2
Gold Member
 
Join Date: Nov 2009
Location: New York
Posts: 370
Default

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

echo "<td><a href:'javascript:GetFlyPic('\"".$row[F_Name]."\"')'>$row[F_Name]</a></td>";
__________________
Submit to my Website Gallery | NY Web Design
bcee is offline   Reply With Quote
Old 11-04-2010, 05:01 AM   #3
Bronze Member
 
Join Date: Jul 2010
Posts: 45
Default

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
bigcougar is offline   Reply With Quote
Old 11-21-2010, 08:14 AM   #4
New Member
 
Join Date: Nov 2010
Posts: 2
Default

Hello.

You can use

'
"
or
\"
__________________
StudioFACA | Nepremičnine
faca5 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 08:20 PM.


Camera Forum - Computer Forum - Web Design Forum

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Content Relevant URLs by vBSEO 3.6.0 ©2011, Crawlability, Inc.