Opp... forgot this.... use htmlspecialchars( ) to fix it. It will convert
your " to " for you. So you code should look like this:
<?PHP
$test = htmlspecialchars ("gerard's name is \"gerard\"");
echo $test."<br>";
echo '<input type="text" name="test2" value="'.$test.'"><br>';
?>
<form action="test2.php" method="post">
<input type="text" name="foo" value="" />
<input type="submit" name="sub" value="submit">
</form>
and it will work :)
- Anthony
Gerard L Petersen" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi
>
> My code looks like this.
>
> <?PHP
> $test = "gerard's name is \"gerard\"";
> echo $test."<br>";
> echo '<input type="text" name="test2" value="'.$test.'"><br>';
> ?>
>
> <form action="test2.php" method="post">
> <input type="text" name="foo" value="" />
> <input type="submit" name="sub" value="submit">
>
> </form>
>
>
> When i run it the bit after the quotes are truncated. Where it truncates
> depends on what type of quote i am using.
>
> Any ideas?
>
> Thanks
>
> Gerard
>
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php