Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7574705
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T16:30:01+00:00 2026-05-30T16:30:01+00:00

Possible Duplicate: Correctly encode characters in a PHP mail form (“I'm” turns to be

  • 0

Possible Duplicate:
Correctly encode characters in a PHP mail form (“I'm” turns to be “I\'m”)

I’m sending an email over PHP and the text arrives with a slash right before the quotation mark:

I'm becomes I\'m

My PHP:

$text_message = $_POST["mymessage"];       


$message="--PHP-mixed-$bound_text\r\n"      
            ."Content-Type: text/plain; charset=\"utf-8\"\r\n"
 ."Content-Transfer-Encoding: 7bit\r\n\r\n" 
       ."$text_message\r\n\r\n" 
    ."--PHP-mixed-$bound_text\r\n"  
            ."Content-Transfer-Encoding: base64\r\n"
            ."Content-Disposition: attachment; filename=\"$attachment\"\r\n"
."Content-Type: image/jpeg; name=\"$attachment\"\r\n\r\n"
 .chunk_split($file)
        ."\r\n\r\n"
            ."--PHP-mixed-$bound_text--\r\n\r\n";
}

How to get it send without receiving an extra slash?
Thanks.
Uli

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T16:30:03+00:00Added an answer on May 30, 2026 at 4:30 pm

    This is caused by PHP’s magic quotes which are deprecated but, unfortunately, still enabled by default. In most cases you can disable the feature through a .htaccess file or even through the webhoster’s control panel.

    If that’s not possible, it’s safest to check if magic quotes are enabled through get_magic_quotes_gpc() before blindly using stripslashes(). To unescape all $_POST[] variables, use:

    if (get_magic_quotes_gpc()) {
        foreach($_POST as $k => $v) {
           $_POST[$k] = stripslashes($v);
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Why does var evaluate to System.Object in “foreach (var row in table.Rows)”?
Possible Duplicate: Where and why do I have to put “template” and “typename” on
Possible Duplicate: Unicode in C++ If I remembered correctly, the default character and string
Possible Duplicate: Space Before Closing Slash? Hi, If I remember correctly we have it
Possible Duplicate: How to pass JS variable to php? pass a js variable to
Possible Duplicate: Get the length of an audio file php i am using php
Possible Duplicate: Consecutive Blank space Removal in C Prompt: A text file contains a
Possible Duplicate: Can't decode JSON string in php I'm at my wits end here,
Possible Duplicate: How to enable PHP short tags ? I am using php version
Possible Duplicate: Timer Won't Fire Correctly Apparently, in Java 1.6, the Timer doesn't work

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.