I turned this case into a simple PHP page that submits to itself. My issue is that I am submitting track meet results and one of the girl's names is Echo...a lovely name.
The problem text I'm s开发者_开发问答ubmitting is: Pole vault - Rachel Simons, Tow, 8-6; Echo Wilson, Cit, 8-0; Molly Randall, Tow, 7-0;
So you see a semicolon followed by white space followed by Echo...
After submitting, it says: POST to /results/test.php not supported
The end goal is to save it to a database along with some other info and have a search page to find it and simply print out the full result on the screen. I stripped out all my database stuff to get it down to this one error. I mean, I can intentionally mis-spell her name, but there's gotta be a way around this, right???
Here's the test PHP file.
<html>
<head>
<title>title</title>
</head>
<body>
<?php
echo "<h3>Edit meet info below</h3>";
echo "<form action=\"test.php\" method=\"post\" id=\"submitForm\">";
echo "Full Results:<br/><textarea NAME=\"results\" id=\"results\" rows=\"20\" cols=\"80\" MAXLENGTH=\"8191\"></textarea><br/><br/>";
echo "<input type=\"submit\" name=\"submitMeet\" value=\"Submit\">";
echo "</form>";
?>
</body>
</html>
It sounds like you have some lame security system (Perhaps mod_security
?) that is scanning the requests and rejecting ones that look like they might be a risk.
You will have to ask your web host or something if they can disable it. There is NO PHP function that will arbitrarily reject a POST request based on any combination of text. (At least, not in this case)
You'll just have to get Echo to change her name... name... name.
Seriously though, look into what webdestroya suggested. If that fails, I think the quick-and-dirty solution would be to change the delimiter you use to separate the names in the POST request, and then change that delimiter back to semicolons after it is received. So you would POST something like this:
Pole vault - Rachel Simons, Tow, 8-6||Echo Wilson, Cit, 8-0||Molly Randall, Tow, 7-0||
Then do this:
$data = str_replace('||', ';', $the_data_you_posted);
If you don't want to manually type the delimiter when entering results, you could write a small JavaScript to convert the semicolons automatically, e.g. on submit.
精彩评论