mattiedog
05-24-2006, 10:21 AM
We are using php to send mail. When we enter some html formmated text into an online form somehow when we receive the email extra slashes are added to the email and the links do not work.
Thanks in advanced
orbitz
05-24-2006, 10:27 AM
your server has magic quote on
http://us3.php.net/manual/en/function.get-magic-quotes-gpc.php
mattiedog
05-24-2006, 12:27 PM
I tried the magic_quotes trick and have read all about it. I do think this the issue, but is it possible that the .htaccess file that I have setup is being ignored. I tring to disable the magic_qoutes but when I loaded the .htacess file to that sub directory I got an internal server error. so I tried a very generic file like the one below:
ErrorDocument 400 /errors/badrequest.html
ErrorDocument 401 /errors/authreqd.html
ErrorDocument 403 /errors/forbid.html
ErrorDocument 404 /errors/notfound.html
ErrorDocument 500 /errors/serverr.html
Then I tried to go to a page that doesnt exist in that sub directory hoping that I would get one of the errors listed above. nothing happened. I loaed the file in ascii mode, set file permnission to 644.
Thanks in advanced
webviz
05-24-2006, 01:07 PM
<?php
$email = trim("username@domain.com");
if(get_magic_quotes_gpc()) {
$email = stripslashes($email);
echo $email; // output: username@domain.com, no slashes what-so-ever.
} else {
echo $email; // output: username@domain.com, no slashes what-so-ever.
}
?>
mattiedog
05-24-2006, 02:46 PM
Thank you both for taking the time to help me.
I struggled for about 5 hours yesterday.
With your help I was able to strip the slashes sodda speak!
Thanks Again