Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 4 of 4
  1. #1
    Senior Member
    Join Date
    Mar 2004
    Posts
    1,518
    Member #
    5220
    Why is it that whenever an apostrophe ( ' ) is typed into a message box and sent to my email inbox via the PHP mail() function, a slash is always displayed before it?

    So, "I'm" becomes "I/'m". Just wondering and how can I stop it from happening?
    Rednerve
    Creative Freelance Design

  2.  

  3. #2
    Senior Member rosland's Avatar
    Join Date
    Jul 2003
    Location
    Norway
    Posts
    1,944
    Member #
    2096
    If magic_quotes are ON (check the php.ini file, or if on an external host use the "ini_get" command to what the status is), then all user input will be automatically escaped with the "\" character.

    You can turn it off (and add the neccessary addslashes() in your script), or use stripslashes() to get rid of the escape character when extracting values.

    You can read more here:
    http://no2.php.net/magic_quotes
    http://no2.php.net/manual/en/functio...es-runtime.php
    http://no2.php.net/manual/en/function.ini-get.php
    S. Rosland

  4. #3
    Senior Member
    Join Date
    Mar 2004
    Posts
    1,518
    Member #
    5220
    I turned all magic_quotes functions in php.ini off but it still adds the slashes.
    Rednerve
    Creative Freelance Design

  5. #4
    Member
    Join Date
    Jan 2005
    Posts
    97
    Member #
    8727
    Just stripslashes() all strings which you don't want the slashes to be there.


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 10:51 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com