WebmasterLingo
Windows 2003, cPanel & DirectAdmin Unix Web Hosting

Go Back   WebmasterLingo > Programming Corner
User Name
Password

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
Old January 11th, 2004, 05:26 PM   #1
airnine
Moderator
 
Join Date: Jan 2004
Posts: 80
airnine is off the scale
Send a message via ICQ to airnine
Cool duble quotes from php into javascript

Hi guys,

I use php and javascript 99% of the time and have a question that's really been bugging me for a while. I have solved it now, but would still like to know how other people deal with this type of things. In both php and javascript one can choose to use either single quotes or double quotes, but what do you do when you pull a message from mysql table that contains double quotes and put it in a php generated javascript alert message? Do you replace " with \" or go for char(34) or some third thing?

Airnine
__________________
-------------------------------
Airnine is a developer @
www.promomedium.com
-------------------------------
airnine is offline   Reply With Quote
Old February 8th, 2004, 05:23 PM   #2
Steveo31
Registered User
 
Join Date: Jan 2004
Posts: 40
Steveo31 is off the scale
Send a message via AIM to Steveo31
I have seen \" used most often. I do that in Flash A.S. as well.
Steveo31 is offline   Reply With Quote
Old February 20th, 2004, 12:15 PM   #3
Matrix28
Registered User
 
Join Date: Feb 2004
Posts: 33
Matrix28 is off the scale
Yeah, as steveo said. Go for the \" option;
Matrix28 is offline   Reply With Quote
Old August 31st, 2005, 07:14 AM   #4
kitty
Registered User
 
Join Date: Aug 2005
Posts: 16
kitty is on a distinguished road
yes u have to use \" or single quate '
__________________
NewEra
web develop
kitty is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT -5. The time now is 03:38 PM.

JustEdge Dedicated Servers