Hello everyone, I have problem with double quotes when passing input value from form -> preview -> submit. My code is as following:

form.php
Code:
<form action="preview.php" method="post">
        <textarea name="contents" rows="4" cols="60" >contents</textarea>
<input type="submit" name="button3" value="submit" />
preview.php
Code:
<?php
    //Gather the information entered from form for preview
    $contents = $_POST['contents'];
?>

<form action="submit.php" method="post">
	<input type="hidden" name="contents" value="<?php print "$contents"; ?>" />
        <input type="submit" name="button3" value="submit" />
</form>

<p><?php print"$contents"; ?></p>
submit.php
Code:
<?php
        $contents = $_POST['contents'];
?>

<p><?php print"$contents"; ?></p>
My current problem is when the input textarea value contains double quotes. In the preview.php stage, it looks fine, but in the submit stage, the text is truncated at the first double quotes encountered. In submit.php, I also enter the $contents value into an MySQL database TEXT field as well. The text is also truncated in the database.

Please help. Thanks.