954,604 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

php error

hello guys .
Can someone tell me how to create a function in php that works whenever someone opens a page that does not exist and at the same time the code notifies me with the error . I have created one but it does not work for all pages . Please tell me how to do it

the prince Awah
Junior Poster
162 posts since Jul 2010
Reputation Points: 5
Solved Threads: 1
 

show your code

muralikalpana
Posting Pro
540 posts since Sep 2009
Reputation Points: 21
Solved Threads: 36
 

You can do this by htaccess file also.
below is the code when user open non existed file then he is redirected to error.php.

ErrorDocument 404 http://localhost/project/error.php
vibhaJ
Posting Shark
931 posts since Apr 2010
Reputation Points: 161
Solved Threads: 183
 
hello guys . Can someone tell me how to create a function in php that works whenever someone opens a page that does not exist and at the same time the code notifies me with the error . I have created one but it does not work for all pages . Please tell me how to do it


Hey, have you try $_SERVER['query_string'], It may be give you the error code or page which currently access by you

Hope this will help you!

HemantPHP
Light Poster
34 posts since Jul 2010
Reputation Points: 10
Solved Threads: 6
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: