Welcome to HostingForumz.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Dealing with quotation marks in a PHP email form

 
   Web Hosting Problem Solving Community! (Home) -> Webmaster RSS
Next:  Need advice in maintainence rate  
Author Message
user115

External


Since: Jul 02, 2003
Posts: 13



(Msg. 1) Posted: Sun Aug 03, 2003 1:59 pm
Post subject: Dealing with quotation marks in a PHP email form
Archived from groups: alt>www>webmaster (more info?)

I recently implemented a PHP email form on my site that works great, but I
have this issue where if someone uses double or single quotation marks I get
backslashes in the email. For example, if someone types in "I'm very bored"
in the text area of the form, it comes to me in the email as \"I\'m very
bored\"

Is there any way to circumvent this, or will I just have to deal with it?

Thanks for any help or reference...

 >> Stay informed about: Dealing with quotation marks in a PHP email form 
Back to top
Login to vote
user104

External


Since: Jun 28, 2003
Posts: 1662



(Msg. 2) Posted: Sun Aug 03, 2003 7:04 pm
Post subject: Re: Dealing with quotation marks in a PHP email form [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Captain Universe" <user DeleteThis @fakeaddresstopreventspam.edu> wrote in message
news:viq8pse9oe4d3d@corp.supernews.com...
 > I recently implemented a PHP email form on my site that works great, but I
 > have this issue where if someone uses double or single quotation marks I
get
 > backslashes in the email. For example, if someone types in "I'm very
bored"
 > in the text area of the form, it comes to me in the email as \"I\'m very
 > bored\"
 >
 > Is there any way to circumvent this, or will I just have to deal with it?
 >
 > Thanks for any help or reference...

You can only do it by changing the script.

You need to use stripslashes() eg:

$name = stripslashes($name);
$message = stripslashes($message);

etc, etc.
--
Charles Sweeney
<a style='text-decoration: underline;' href="http://www.CharlesSweeney.com" target="_blank">www.CharlesSweeney.com</a><!-- ~MESSAGE_AFTER~ -->

 >> Stay informed about: Dealing with quotation marks in a PHP email form 
Back to top
Login to vote
blackcat2

External


Since: Jun 28, 2003
Posts: 585



(Msg. 3) Posted: Mon Aug 04, 2003 3:04 am
Post subject: Re: Dealing with quotation marks in a PHP email form [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Charging up on a white horse Charles Sweeney said:
: You can only do it by changing the script.
:
: You need to use stripslashes() eg:
:
: $name = stripslashes($name);
: $message = stripslashes($message);

Listen to him, he is the man when it comes to this. *grin*
p.s. Thanks again Charles. *grin*

--
Heidi
PaidToReads: http://www.paidtoreads.com/
Recommended Hosting: http://www.page-zone.com/
http://www.webmaster-talk.com/index.php?referrerid=146
 >> Stay informed about: Dealing with quotation marks in a PHP email form 
Back to top
Login to vote
user104

External


Since: Jun 28, 2003
Posts: 1662



(Msg. 4) Posted: Mon Aug 04, 2003 1:36 pm
Post subject: Re: Dealing with quotation marks in a PHP email form [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Heidi" <blackcat2.RemoveThis@zwallet.com> wrote in message
news:CqhXa.145835$hV.9478249@twister.austin.rr.com...
 > Charging up on a white horse Charles Sweeney said:
 > : You can only do it by changing the script.
 > :
 > : You need to use stripslashes() eg:
 > :
 > : $name = stripslashes($name);
 > : $message = stripslashes($message);
 >
 > Listen to him, he is the man when it comes to this. *grin*
 > p.s. Thanks again Charles. *grin*

Yep, the Master of the stripslashes. Now for the other 5,000 functions!
--
Charles Sweeney
<a style='text-decoration: underline;' href="http://www.CharlesSweeney.com" target="_blank">www.CharlesSweeney.com</a><!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Dealing with quotation marks in a PHP email form 
Back to top
Login to vote
blackcat2

External


Since: Jun 28, 2003
Posts: 585



(Msg. 5) Posted: Mon Aug 04, 2003 9:40 pm
Post subject: Re: Dealing with quotation marks in a PHP email form [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Charging up on a white horse Charles Sweeney said:
: Yep, the Master of the stripslashes. Now for the other 5,000
: functions!

well had you dreamed about it? I woke up this morning to find
myself dreaming about coding a page that pulled from a SQL
database. *blush*

Heidi

--
Heidi
PaidToReads: http://www.paidtoreads.com/
Recommended Hosting: http://www.page-zone.com/
http://www.webmaster-talk.com/index.php?referrerid=146
 >> Stay informed about: Dealing with quotation marks in a PHP email form 
Back to top
Login to vote
user115

External


Since: Jul 02, 2003
Posts: 13



(Msg. 6) Posted: Mon Aug 04, 2003 10:03 pm
Post subject: Re: Dealing with quotation marks in a PHP email form [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

 > You can only do it by changing the script.
 > You need to use stripslashes() eg:
 > $name = stripslashes($name);
 > $message = stripslashes($message);

Thanks for the tip, Charles. Where in the script should these lines go? This
is the first PHP script I've ever implemented, so I'm a little raw.

Many thanks!<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Dealing with quotation marks in a PHP email form 
Back to top
Login to vote
user104

External


Since: Jun 28, 2003
Posts: 1662



(Msg. 7) Posted: Mon Aug 04, 2003 11:41 pm
Post subject: Re: Dealing with quotation marks in a PHP email form [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Heidi" <blackcat2.TakeThisOut@zwallet.com> wrote in message
news:lMxXa.147092$hV.9577282@twister.austin.rr.com...

 > well had you dreamed about it? I woke up this morning to find
 > myself dreaming about coding a page that pulled from a SQL
 > database. *blush*

I had a dream too where I pulled, but that's another story!
--
Charles Sweeney
<a style='text-decoration: underline;' href="http://www.CharlesSweeney.com" target="_blank">www.CharlesSweeney.com</a><!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Dealing with quotation marks in a PHP email form 
Back to top
Login to vote
user104

External


Since: Jun 28, 2003
Posts: 1662



(Msg. 8) Posted: Mon Aug 04, 2003 11:46 pm
Post subject: Re: Dealing with quotation marks in a PHP email form [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Captain Universe" <user.TakeThisOut@fakeaddresstopreventspam.edu> wrote in message
news:a6yXa.16388$Vx2.8465799@newssvr28.news.prodigy.com...
  > > You can only do it by changing the script.
  > > You need to use stripslashes() eg:
  > > $name = stripslashes($name);
  > > $message = stripslashes($message);
 >
 > Thanks for the tip, Charles. Where in the script should these lines go?
This
 > is the first PHP script I've ever implemented, so I'm a little raw.

Difficult to say for sure without seeing the script.

As long as it appears before the mail function mail() the slashes will be
removed BEFORE you send the mail!

Experiment with it.
--
Charles Sweeney
<a style='text-decoration: underline;' href="http://www.CharlesSweeney.com" target="_blank">www.CharlesSweeney.com</a><!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Dealing with quotation marks in a PHP email form 
Back to top
Login to vote
user115

External


Since: Jul 02, 2003
Posts: 13



(Msg. 9) Posted: Tue Aug 05, 2003 3:28 am
Post subject: Re: Dealing with quotation marks in a PHP email form [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

 > As long as it appears before the mail function mail() the slashes will be
 > removed BEFORE you send the mail!
 >
 > Experiment with it.

I did just that and it worked like a charm. Thanks again...<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Dealing with quotation marks in a PHP email form 
Back to top
Login to vote
blogan

External


Since: Jun 30, 2003
Posts: 285



(Msg. 10) Posted: Tue Aug 05, 2003 11:49 am
Post subject: Re: Dealing with quotation marks in a PHP email form [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Charles Sweeney" <me.RemoveThis@charlessweeney.com> wrote in message
news:bgl9ei$p6o8o$1@ID-162618.news.uni-berlin.de...
 > "Heidi" <blackcat2.RemoveThis@zwallet.com> wrote in message
 > news:CqhXa.145835$hV.9478249@twister.austin.rr.com...
  > > Charging up on a white horse Charles Sweeney said:
  > > : You can only do it by changing the script.
  > > :
  > > : You need to use stripslashes() eg:
  > > :
  > > : $name = stripslashes($name);
  > > : $message = stripslashes($message);
  > >
  > > Listen to him, he is the man when it comes to this. *grin*
  > > p.s. Thanks again Charles. *grin*
 >
 > Yep, the Master of the stripslashes. Now for the other 5,000 functions!

As long as people do not start calling you the strip slashes master Smile<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Dealing with quotation marks in a PHP email form 
Back to top
Login to vote
Display posts from previous:   
   Web Hosting Problem Solving Community! (Home) -> Webmaster All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]