<form action="" method="POST">
<input type="text" name="status" id="status" value="<?php print($_POST['status']);?>"><br />
<input type="submit" name="submit" value="Submit!">
</form>
<?php
if(isset($_POST['status']))
{
if($_POST['status'] == "tired")
{
print "Bob is tired.";
}
elseif($_POST['status'] != "tired")
{
if(!$_POST['status'])
{
print "Bob is not tired.";
}
else
{
print "Bob is " . $_POST['status'] . ".";
}
}
}
?>
Why does running the script with this input:
5' 10"
Output:
Bob is 5\' 10\".
Submitting the form (which carries over the previous value) doubles the number of slashes after 5 plus an extra. Also the number of slashes after 10 doubles (without adding an extra one). After about 13 submits with the new value Firefox crashes. (Maybe since its the Linux version?). Opera and Konquorer didn't crash after any number of submits (still add slashes), but they gave up after some number of submits (I didn't count them).
Anyone care to explain the slashes/crashes?
Thanks in advance.