0

Code:

        echo '<form method="POST" action="test.php" id="textarea">
        <textarea rows="40" cols="200" name="textarea" form="textarea">Text</textarea><br>
        <input type="submit">
        </form>';

        $string = $_POST["textarea"];
        exit();

When I have a string that contains the word "substring" example: JustSomeText&substring.SomeMoreText I have the following error:

Not Acceptable

An appropriate representation of the requested resource /test.php could not be found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

I am clueless about this error. I know that the problem is with the word substring and with the method POST but tried to google it without any success.

Edited: test.php is the file where the code is contained. I have narrowed the code that is responsible for the error above. All works fine even with huge strings with all kinds of characters but when that word is in the string I have that error.

2Noob2Good
  • 159
  • 1
  • 12
  • 1
    are you sure, test.php exists? try to remove the action attribute and the form will submited to the same page – Philipp Nov 28 '13 at 23:31
  • Instead of just posting some of your code but not the one directly related to the error do it otherwise, please – Francisco Presencia Nov 28 '13 at 23:34
  • 1
    Either what Philipp says, or an overly paranoid abuse detection system. Talk to the sysadmin about it. – Wrikken Nov 28 '13 at 23:34
  • @Philipp I have done that and error is the same. – 2Noob2Good Nov 28 '13 at 23:46
  • @FranciscoPresencia I don't understand exactly what you mean – 2Noob2Good Nov 28 '13 at 23:47
  • @Wrikken Hmmm what do you mean by that? The sysadmin usually forbids something in POST method besides size? – 2Noob2Good Nov 28 '13 at 23:48
  • 1
    Not usually, for good reasons, such as this. There are however misguided souls who think it _is_ a good idea. So best check that first if you notice that certain strings (most likely: strings that are function names in one language or another) are being blocked with a _"not acceptable"_. – Wrikken Nov 28 '13 at 23:50
  • @Wrikken thank you. I will check with sysadmin if it's a problem on their side. – 2Noob2Good Nov 29 '13 at 00:07
  • 1
    I would not know in your case but it is definitely possible to show `406 Not Acceptable` if a certain string is present in any of the user input . My answer for question [PHP/Apache Error:406 Not Acceptable](http://stackoverflow.com/questions/20154423/php-apache-error406-not-acceptable/20207058#20207058) might give an idea even if it does not help . – Uours Nov 29 '13 at 00:25
  • Yup... I will have to check with sysadmin. In this case the word "substring" in the POST method is the problem. – 2Noob2Good Nov 29 '13 at 02:13

1 Answers1

0

It was a problem on the sysadmin. I've talked to them and it's now solved. I've asked for more details. If the sysadmin gives me more information I will post it here.

2Noob2Good
  • 159
  • 1
  • 12