Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > JavaScript > Backslash-apost...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 5 Topic 36380 of 37166
Post > Topic >>

Backslash-apostrophe POOF.

by Razzbar <glakk@[EMAIL PROTECTED] > Jul 25, 2008 at 06:47 PM

I'm working on a bookmarklet that grabs information from a page and
submits it to a server. Yet another social bookmarking application.
I'm having trouble with page titles that include an apostrophe.

I'm using encodeURIComponent() around the page title, and again around
the URL. Apparently the browser is inserting a backslash before any
apostrophe. I can see that when I write the $_GET data to a file in
PHP on the server. When the GET data is processed, PHP generates a
page with a form, and the data is plugged into some input fields. The
page is sent to the user's browser for editing and approval, and
there's where the problem shows up. Here's the transformation...

Say we have a page with the title "Here's the page"    (minus the
outer quotes)

Page title: -->   Here's the page            // the title gets
encodeURIComponent
PHP gets -->    Here\'s the page           // a backslash gets
inserted somehow.
HTML form -->  Here\                          // truncated!

I don't know why this is happening, or what to do about it. I tried
using PHP stripslashes() and that doesn't do it. What do I need to
do?
 




 5 Posts in Topic:
Backslash-apostrophe POOF.
Razzbar <glakk@[EMAIL   2008-07-25 18:47:57 
Re: Backslash-apostrophe POOF.
"Tim Williams"   2008-07-25 19:31:08 
Re: Backslash-apostrophe POOF.
Razzbar <glakk@[EMAIL   2008-07-25 19:47:45 
Solved: Backslash-apostrophe POOF.
Razzbar <glakk@[EMAIL   2008-07-25 19:54:08 
Re: Solved: Backslash-apostrophe POOF.
Thomas 'PointedEars' Lahn  2008-07-26 05:13:24 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Tue Oct 14 9:43:04 CDT 2008.