General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old August 14th, 2003, 09:51 PM
robsta robsta is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Pacific NW, U.S.A.
Posts: 146 robsta User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Removing backslashes from form contents

Hi -

When my form results arrive at my designated e-mail address, I get backslashes accompanying all the apostrophes and quotation marks.

Any way to correct this?

Example: it\'s, hasn\'t

I'm new to PHP, so it's got to be pretty easy for me to implement - I just tweek the variables and cross my fingers... it's worked so far.

Here's the code:

<? include ("common.php"); ?>

PHP Code:
<? 
$Message 
"Name: $name\n";
$Message .= "How did you find us: $find\n";
$Message .= "Email: $email\n";
$Message .= "URL: $address\n";
$Message .= ".................\n";
$Message .= "Message: $message\n";
$Message .= "\n";
$Message .= ".................\n";
$Message .= "$HTTP_USER_AGENT\n";
mail("$admin_email""$email_subject"$Message "From: $email");
?>


common.php script:

PHP Code:
<?
$admin_email 
"info@fond-regards.com";  // Your email address
$email_subject "Customer response";  // Email Subject
?>


If you need more info, let me know.

Thanks!

Robsta

Reply With Quote
  #2  
Old August 15th, 2003, 12:03 AM
laidbak laidbak is offline
you know how we do
Dev Articles Novice (500 - 999 posts)
 
Join Date: Jun 2002
Location: In Tha IE -- San Bernardino COUNTY
Posts: 788 laidbak User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 4 m 2 sec
Reputation Power: 7
Send a message via ICQ to laidbak Send a message via AIM to laidbak Send a message via MSN to laidbak Send a message via Yahoo to laidbak
PHP Code:
 mail("$admin_email""$email_subject"stripslashes($Message) , "From: $email"); 
__________________
__________________________________________________ _
Wil Moore III, MCP | Integrations Specialist | Senior Consultant
Are You Listed...? | DigitallySmooth Inc.

Reply With Quote
  #3  
Old August 15th, 2003, 10:03 AM
robsta robsta is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Pacific NW, U.S.A.
Posts: 146 robsta User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Thumbs up That was easy - thanks!!

Thanks Laidbak.

Robsta -

Reply With Quote
  #4  
Old August 15th, 2003, 12:22 PM
laidbak laidbak is offline
you know how we do
Dev Articles Novice (500 - 999 posts)
 
Join Date: Jun 2002
Location: In Tha IE -- San Bernardino COUNTY
Posts: 788 laidbak User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 4 m 2 sec
Reputation Power: 7
Send a message via ICQ to laidbak Send a message via AIM to laidbak Send a message via MSN to laidbak Send a message via Yahoo to laidbak
Anytime Robsta...

Reply With Quote
  #5  
Old August 15th, 2003, 10:33 PM
jpenn jpenn is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Location: Washington, DC
Posts: 317 jpenn User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 m 3 sec
Reputation Power: 6
You can also set this up to work across multiple platforms (ie: one server has gpc enabled and you use the same app on another that has it disabled):
PHP Code:
function strip_slashes$data )
{
    if ( ( bool )
get_magic_quotes_gpc() )
    {
        return( 
stripslashes$data ) );
    }
    else
    {
        return( 
$data );
    }
}


mail("$admin_email""$email_subject"strip_slashes($Message) , "From: $email"); 
__________________
~ Joe Penn

We work for free to help make this a valuable resource on the internet. Do you appreciate the help - did we provide help that will help you prosper and help that has contributed to sharpening your current skill set?

Show your appreciation and purchase something from our Amazon Wishlist's - it's simple and a great way to say thank you.




Reply With Quote
  #6  
Old August 15th, 2003, 11:05 PM
robsta robsta is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Pacific NW, U.S.A.
Posts: 146 robsta User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Thumbs up Thanks!

Thanks jpenn -

I'll give it a try tomorrow.

Robsta

Reply With Quote
  #7  
Old August 18th, 2003, 09:18 PM
digitalamit digitalamit is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: New Delhi, India
Posts: 19 digitalamit User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to digitalamit Send a message via AIM to digitalamit Send a message via Yahoo to digitalamit
Also if you are looking at parsing form data, you may want to check SafeExtract

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > Removing backslashes from form contents


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway