0
Warning: Unknown: POST Content-Length of 49 bytes exceeds the limit of 40 bytes in Unknown on line 0

Warning: Cannot modify header information - headers already sent in Unknown on line 0

My HTML passes 4 string parameters to a a PHP trough a POST form, and when I do not enter anything I get these errors up until I get to the portion of my code that checks if a string from $_POST is empty.

I looked it up online and it was all stuff related to file uploading, but why exactly is it happening to me?

And what else should I know about creating a stable PHP script? I don't want my users to see these kinds of things. Maybe I can at the very least server one of my own pages instead of these to serve the errors to the client?

Thank you!


    <html>
    
        <body>
        
        <form action="register.php" method="POST">
            <input type="text" name="ID" placeholder="ID"><br>
            <input type="text" name="PASS"  placeholder="Password"><br>
            <input type="text" name="UID" placeholder="ID2"><br>
            <input type="text" name="UPASS" placeholder="Password2"><br>
        
            <input type="submit" value="Register">
        </form>
        
        </body>
        
        </html>

php.ini file.

Vidal
  • 2,605
  • 2
  • 16
  • 32
orORorOR
  • 143
  • 9

1 Answers1

3

Update your value on the php.ini file from post_max_size=40 to a bigger value. 40m for example.

and restart your apache after the change is done.

Vidal
  • 2,605
  • 2
  • 16
  • 32
  • You'll notice in his php.ini that it is first defined as `post_max_size=40M`, but then later in the same ini, its redefined as `post_max_size=40` ... oops. – IncredibleHat Jun 25 '20 at 12:44