J
Jeremy G
Guest
When submitting a form, PHP trims the input of a textbox to the first word before a space.
Ex:
I type in: "The Mummy Returns"
And upon submitting the form, PHP reads the variable as "The"
Code is as below:
if($id && $title) {
mysql_query("delete from story where id=$id");
mysql_query("insert into story values($id, '$title')");
}
echo("
<form method=post action=setup.php>
ID: <input type=text name=id size=10 value=$id>
Title: <input type=text name=\"title\" size=25 value=$story[title]>
<input type=submit name=task value=Save>
<input type=submit name=task value=Delete>
</form>
");
Ex:
I type in: "The Mummy Returns"
And upon submitting the form, PHP reads the variable as "The"
Code is as below:
if($id && $title) {
mysql_query("delete from story where id=$id");
mysql_query("insert into story values($id, '$title')");
}
echo("
<form method=post action=setup.php>
ID: <input type=text name=id size=10 value=$id>
Title: <input type=text name=\"title\" size=25 value=$story[title]>
<input type=submit name=task value=Save>
<input type=submit name=task value=Delete>
</form>
");