While uploading image I'm getting this error: (max 8mb an image)
Warning: POST Content-Length of 14259306 bytes exceeds the limit of 8388608 bytes in Unknown on line 0
How can I display this message customly? I mean I want to put that error in CSS style. thank you....
In case of common errors you need to set error handler. See here for details. BUT
If errors occur before the script is executed (e.g. on file uploads) the custom error handler cannot be called since it is not registered at that time.
Maybe you wanna try something like this.
if (isset($_SERVER["CONTENT_LENGTH"])) {
if ($_SERVER["CONTENT_LENGTH"] > ((int)ini_get('post_max_size') * 1024 * 1024)) {
die('<script type="text/javascript">window.open("some page youre gonna handle the error","_self");</script>');
}
}
if ($_SERVER['CONTENT_LENGTH'] < 8380000) {
... your code
} else {
... Your Error Message
}
You can also increase the maximum size in the php.ini
post_max_size = 60M
upload_max_filesize = 60M
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With