hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Programming Discussion : Escaping single quote
Reply

Programming Discussion Discussions related to web programming languages and other related issues. Topics may include configuration, optimization, practical usage and database connectivity.
Forum Jump

Escaping single quote

Reply Post New Thread In Programming Discussion Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 09-11-2002, 01:40 AM
HighRPM HighRPM is offline
New Member
 
Join Date: Aug 2002
Posts: 2

Escaping single quote


Did a search already but couldn't seems to find the answer... anyway..

I am having problem with escaping single quote '

I am not sure about this but it appears to me that if I pass a string from one page to another, the characters needed to be escaped will have a backslash add before them automatically.

The problem I am experiencing is that when I use backslash (via addslashes())in a string to escape a single quote, the result I got after passing it thru a hidden form to another page is the string with the added backsalsh getting backslashed ~-~ And everything after the 2 backslashes are missing...

The following demonstartes how I ended up with 2 backslashes:

action: Pass string "I'm a newbie" into another page
result: "I\'m a newbie" get passed into another page

action: use stripslashes() to remove backslash then display the content
result: "I'm a newbie" displayed

action: use addslashes() to add backslash to escape the single quote
result: "I\'m a newbie"

action: pass it onto another page thru hidden form <input type=....... value='$temp'), $temp stores the string
result: attempting to display passed variable $temp and got "I\\" displayed.. everything else disappeared..

I have no idea what's going on but it is really bugging me ~-~

Could someone please help me with this???

Reply With Quote


Sponsored Links
  #2  
Old 09-11-2002, 02:05 AM
prosayist prosayist is offline
Junior Guru Wannabe
 
Join Date: Dec 2001
Location: New Hampshire
Posts: 93
stripslashes(stripslashes($.. ))

don't know if that helps any cause I really don't understand your situation, but sometimes that's what ya gotta do

__________________
WYSIWYG

Reply With Quote
  #3  
Old 09-11-2002, 04:10 AM
Rich2k Rich2k is offline
Web Hosting Master
 
Join Date: May 2002
Location: UK
Posts: 2,994
I can't remember exactly as I don't get this problem but it could be something to do with magic_quotes enabled or the various derivatives thereof?

Reply With Quote
Sponsored Links
Reply

Related posts from TheWhir.com
Title Type Date Posted
Advanced Internet Technologies Launches Customer Management System Web Hosting News 2013-05-17 14:35:19
Netwise Hosting Launches Real-time Colocation Cost Calculator Web Hosting News 2012-06-22 15:00:14
Dimension Data says It’s Time for Africa - Cloud is the new IT Core Blog 2012-03-28 11:15:36
UK Web Host Phoenix Unites Brands Under Single Entity Web Hosting News 2012-01-10 19:02:56
GlowTouch CSO Michael Fountain Gives Blueprint for Turning Ideas into Products Web Hosting News 2011-08-10 23:29:24


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

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 Off
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?