hi, sometimes when i run a script i receive this error: Fatal error: Allowed memory size i need to send a alert some like this: echo "<script> alert ( ' '); <script>"; when a error is detected there is a error handler in php? something like this: on error goto x thanks a lot for your help
Set_error_handler doesn't work with fatal errors ;-) I don't think it's possible to make a custom error handler for this error, although you can try somethings with sending javascript at the beginning of the file, and disabeling when loaded, but i doubt it if that will work right...
I would try to do try and catch statements like try{ DoStuff(); }catch(Exception $e){ DoThisOnFail(); }
I don't use try and catch statement that much, but I'm quite sure it won't work in this situation, because nothing is thrown. There are 2 solutions to this problem: 1.Increase the allowed memory size 2.Edit your script, so it does need less memory.
Yeah your right, the try and catch wouldn't work here. Was late last night and i just realized i was wrong. He would have to go with Edit his script to use less memory since to change the php allowed memory in php.ini would require root access to the box.