Good morning to the forum! (morning here, anyways).🙂
I have a problem. I am passing a string of text via POST that may or may not contain quotation marks. The problem is, PHP is doing something strange; it keeps chopping off the section containing the quotes. Code follows demonstrating this:
<html>
<head>
<title>Test Send</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<?php
print "<font color='#FF0000'>".$_POST['test']."<br /></font>";
?>
<form action="test.php" method="post">
<input type="text" name="test" value="<?php print $_POST['test']; ?>">
<input type="submit">
</form>
</body>
</html>
If you enter a string like Hello "World", the variable prints as Hello \"World\" the first time, and Hello \ the second time. The backslashes get worse as you keep hitting the submit button. I have no idea why this is.
I would really appreciate anyone's help with solving this. Thank you in advance for even taking a look.
AT