quotes problem....

A

Anonymous

Guest
Hi

I have some problems with quotes...

I have 3 pages:
1st page is where i fill out a form and submit it
2nd is the preview page
3rd inserts data to database

now the problem is when i on 1st page enter text into editbox let's say:

some text "what" is this?

then i submit this data and on 2nd page i put this text
into hidden type field, the result is:

some text \

oki so i fixed this with stripslashes and i get
on second page then:

some text "what" is this?

yes this is what i want but when i submit this hidden field
to 3rd page, i get either:

some text \\ (using stripslashes)
or
some text (using just _post)

each time it clears off the text after "

how to fix this??

help needed
 
1st page simple form
2nd page
echo stripslashes($_POST['msg'])
3rd page
$msg=addslashes("$_POST[msg]");
INSERT INTO `base` (`coll`) VALUES ('$msg')
 
Hi

i tried your way, but it still cuts off words.
i used: test "a"
and i got: test :evil:

any other idea?
 
Have you got magic quotes turned on? (personally i hate them)
 
its the same result if magic quotes are ON or if they are OFF, so
any other idea avaible?:)

i'm driving my self crazy with this... HEEEEEEEEEEEEEEEEEEELP
 
I created new forms and here the code for them:

form.php (1st page)
/////////////////////
<html>

<head>
</head>

<body>

<form method="POST" action="preview.php">
<p><input type="text" name="msg" size="20"><input type="submit" value="Submit" name="B1"><input type="reset" value="Reset" name="B2"></p>
</form>

</body>

</html>
//////////////////////

preview.php (2nd page)
//////////////////////
<html>

<head>

</head>

<body>
<?
$msg = $_POST['msg'];
//$msg = addslashes("$_POST[msg]");
echo $msg;
?>
<br>

<form method="POST" action="end.php">
<p><input type="submit" value="Submit" name="B1"><input type="reset" value="Reset" name="B2"></p>
<input type="hidden" name="msg" value="<?=$msg?>">
</form>

</body>

</html>
////////////////////

end.php (3rd page)
/////////////////
<html>

<head>
</head>

<body>
<?
$msg = $_POST['msg'];
//$msg = addslashes("$_POST[msg]");
//or
//$msg = stripslashes("$_POST[msg]");
echo $msg;
?>
</body>

</html>
/////////////

i tried with this form and also it doesn't work!
my magic quotes are OFF.

anyone knows what's wrong?

i think the problem is between preview and end page, cause if i use preview page as an end page it works fine...

who can fix this?:)
 
have you tried
Code:
'INSERT INTO `base` (`coll`) VALUES ("'.mysql_escape_string($msg).'")'
 
Yes i tried also using mysql_escape_string and the result is the same!

using insert without slashes, the output is: test
using slashes: test \\\\

any other idea?
 
Back
Top