HTML Tutorial


 /help/HTML Help Forum   FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
RegisterRegister - Not registered yet? Got something to say? Join HTML Code Tutorial!
Commas and quotes changing to \\\"
Post new topic   Reply to topic    HTML Help Forum -> PHP
View previous topic :: View next topic  
Author Message
PsxMeUP



Joined: 26 Sep 2009
Posts: 1

PostPosted: Sat Sep 26, 2009 4:19 am     Commas and quotes changing to \\\" Reply with quote

Hi, I have a site where commas and quotes change to \" once the article is posted.

Some have proposed that it's because magic_quotes are set to on (and they are because I checked using <?php phpinfo(); ?>). I checked my php.ini file and it doesn't have that code, meaning it's probably set up on my hosting provider's side. So shat are my options? Should I turn them off somehow? Isn't it better to have them on? Is there some code I can add to fix this problem? The site lets users post game reviews, and the last thing I want is a note saying "Warning, you must type your text in Word first," cause it would look lame, and I definitely want the site to be perfectly optimized.
gary.newelluk



Joined: 12 May 2005
Posts: 552
Location: Inverurie, Scotland

PostPosted: Sun Sep 27, 2009 1:05 pm     Removing magic quotes Reply with quote

Hi there,

If magic quotes are turned on use stripslashes to remove the extra slash as follows:

Code:

<?php
echo "Removed Slashes: ";
// Remove those slashes
if(get_magic_quotes_gpc())
   echo stripslashes($_POST['question']);
else
   echo $_POST['question'];
   
?>

<form method='post'>
Question: <input type='text' name='question'/><br />
<input type='submit'>

</form>


Visit http://www.tizag.com/phpT/php-magic-quotes.php for a full explanation.
stoyv



Joined: 06 Jan 2010
Posts: 6

PostPosted: Sat Jan 16, 2010 8:01 am     Php Form, Web form Builder, HTML Forms, Email forms Reply with quote

Please look up here this site http://phpforms.net/tutorial.html where you can find the answer to your question.
Display posts from previous:   
Post new topic   Reply to topic    HTML Help Forum -> PHP All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot 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
HTML Help Archive
Powered by phpBB © 2001, 2005 phpBB Group
HTML Help topic RSS feed 

 
DARFUR
HOSTING / DESIGN
MAKE MONEY

Home
  |   Tutorials   |   Forum   |   Quick List   |   Link Directory   |   About
Copyright ©1997-2002 Idocs and ©2002-2007 HTML Code Tutorial