Karlos Posted February 18, 2009 Posted February 18, 2009 Well i choose the main 5 error the clients and we ourseleves see: 400, 403, 404, 500 and 505. Add this into your .htaccess You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. and create a file called errors.php and place the following in: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Quote
Jambomb Posted February 18, 2009 Posted February 18, 2009 Re: [MC Code V2] Custom Error Pages kooool :) Quote
Lithium Posted February 18, 2009 Posted February 18, 2009 Re: [MC Code V2] Custom Error Pages nice go, yet i hate the damn <meta> forwarding. try this :) time_sleep_until(time()+0.5); header('Location: login.php'); instead the <META HTTP-EQUIV=Refresh CONTENT="5;url=login.php"> Note: you can't test it under windows machines unless you already have PHP 5.3 (can be get on the daily CVS) Quote
John99 Posted February 19, 2009 Posted February 19, 2009 Re: [MC Code V2] Custom Error Pages Why when you could add at the top ob_start(); Then header("Location: index.php"); Why send them to index.php? to check if there loggedin! if not it will send them to login.php page! Quote
Haunted Dawg Posted February 19, 2009 Posted February 19, 2009 Re: [MC Code V2] Custom Error Pages Crazy-T, the header("location"); will automaticly direct them to a page without them seeing the page. Quote
Karlos Posted February 19, 2009 Author Posted February 19, 2009 Re: [MC Code V2] Custom Error Pages nice go, yet i hate the damn <meta> forwarding. try this :) time_sleep_until(time()+0.5); header('Location: login.php'); instead the <META HTTP-EQUIV=Refresh CONTENT="5;url=login.php"> Note: you can't test it under windows machines unless you already have PHP 5.3 (can be get on the daily CVS) Dosen't work :wink: takes me straight to login. Why when you could add at the top ob_start(); Then header("Location: index.php"); Why send them to index.php? to check if there loggedin! if not it will send them to login.php page! They won't see the menu.. and anyway if they not logged in globals.php have already a function to kick them to login if they aren't loggedin. I have aleady thought od numerous idea's and suggestions. My way is good enough and will be good enough to everyone else. Crazy-T, the header("location"); will automaticly direct them to a page without them seeing the page. And thanks Killah to state that obvious point. Quote
Lithium Posted February 19, 2009 Posted February 19, 2009 Re: [MC Code V2] Custom Error Pages Dosen't work :wink: When you say doesn't work... on windows machines... it does not as i told! Other than that, take Crazy_T suggestion and add the ob_start(); on top and it would work without giving the "headers already sent" error message :) Quote
Karlos Posted February 19, 2009 Author Posted February 19, 2009 Re: [MC Code V2] Custom Error Pages Note: you can't test it under windows machines unless you already have PHP 5.3 (can be get on the daily CVS) i am using windows so i can't test it unless i have PHP 5.3, which i do on my WAMP server.. Quote
Haunted Dawg Posted February 19, 2009 Posted February 19, 2009 Re: [MC Code V2] Custom Error Pages So much fuss about the header thing. Just use this one: @header("Refresh: 3; url=index.php"); Quote
Karlos Posted February 19, 2009 Author Posted February 19, 2009 Re: [MC Code V2] Custom Error Pages Use Killah's way, i like mine how it is :wink: Quote
John99 Posted February 19, 2009 Posted February 19, 2009 Re: [MC Code V2] Custom Error Pages Okay.. Who like's Meta Refresh? Quote
Karlos Posted February 19, 2009 Author Posted February 19, 2009 Re: [MC Code V2] Custom Error Pages I don't use it all the time, it's not bad. Quote
John99 Posted February 19, 2009 Posted February 19, 2009 Re: [MC Code V2] Custom Error Pages Yeah same if like someone is voting on a site like You are voting at C.E topwebgames redirecting in 3 seconds Quote
Lithium Posted February 19, 2009 Posted February 19, 2009 Re: [MC Code V2] Custom Error Pages Yeah same if like someone is voting on a site like You are voting at C.E topwebgames redirecting in 3 seconds But you know, all the above codes do exactly the same. so its just a matter of preference on what to use ;) Quote
Gangsta Posted February 19, 2009 Posted February 19, 2009 Re: [MC Code V2] Custom Error Pages Intresting! Quote
Magictallguy Posted February 19, 2009 Posted February 19, 2009 Re: [MC Code V2] Custom Error Pages Intresting! Posting 1 word threads is pointless.. If you're trying to get your post count up, post something worth the time typing! Quote
Gangsta Posted February 19, 2009 Posted February 19, 2009 Re: [MC Code V2] Custom Error Pages Well sorry to say i dont care what you think!!! Quote
Magictallguy Posted February 19, 2009 Posted February 19, 2009 Re: [MC Code V2] Custom Error Pages Well sorry to say i dont care what you think!!! Not just me Ikram Quote
Karlos Posted February 20, 2009 Author Posted February 20, 2009 Re: [MC Code V2] Custom Error Pages Well i also agree with Magic, post something good or stop spamming my thread. Quote
John99 Posted February 21, 2009 Posted February 21, 2009 Re: [MC Code V2] Custom Error Pages Intresting! All you have to say is Intresting! lol! Quote
POG1 Posted February 21, 2009 Posted February 21, 2009 Re: [MC Code V2] Custom Error Pages Yeah same if like someone is voting on a site like You are voting at C.E topwebgames redirecting in 3 seconds But you know, all the above codes do exactly the same. so its just a matter of preference on what to use ;) Not entirely true, then will all do the same job however. The php version will do it when the page is processed, Whereas the HTML will be a client side refresh and will happen when the page is cached. The page shouldn't be frereshed, the user should know what is wrong. Also with 404 you should get the game layout... Quote
Lithium Posted February 21, 2009 Posted February 21, 2009 Re: [MC Code V2] Custom Error Pages Not entirely true, then will all do the same job however. The php version will do it when the page is processed, Whereas the HTML will be a client side refresh and will happen when the page is cached. The page shouldn't be frereshed, the user should know what is wrong. Also with 404 you should get the game layout... Quite true indeed, so my post should've been... final result will be the same ;) Quote
Paddy Posted February 22, 2009 Posted February 22, 2009 Re: [MC Code V2] Custom Error Pages Y should i use this, what benefits does it have? does it hide Like query errors so users/owner dont see them or is it when its an Invalid use of file? can something like that be done on folders in directory for example "/images" redirect to (login.php) or any other page Quote
POG1 Posted February 22, 2009 Posted February 22, 2009 Re: [MC Code V2] Custom Error Pages Y should i use this, what benefits does it have? does it hide Like query errors so users/owner dont see them or is it when its an Invalid use of file? can something like that be done on folders in directory for example "/images" redirect to (login.php) or any other page Have you ever seen broken links where it says "404 page not found" or something? This will allow you to add custom error pages instead of that Also, there isn't much sense in redirecting an image. You can however block images being used not on your website, check this out.. RewriteEngine on RewriteCond %{HTTP_REFERER}!^$ RewriteCond %{HTTP_REFERER}!^http://(www\.)?YOURDOMAIN.com/.*$ [NC] RewriteRule .*\.(jpg?jpeg?gif?png?bmp)$ - [F] Quote
Lithium Posted February 22, 2009 Posted February 22, 2009 Re: [MC Code V2] Custom Error Pages Y should i use this, what benefits does it have? does it hide Like query errors so users/owner dont see them or is it when its an Invalid use of file? can something like that be done on folders in directory for example "/images" redirect to (login.php) or any other page Have you ever seen broken links where it says "404 page not found" or something? This will allow you to add custom error pages instead of that Also, there isn't much sense in redirecting an image. You can however block images being used not on your website, check this out.. RewriteEngine on RewriteCond %{HTTP_REFERER}!^$ RewriteCond %{HTTP_REFERER}!^http://(www\.)?YOURDOMAIN.com/.*$ [NC] RewriteRule .*\.(jpg?jpeg?gif?png?bmp)$ - [F] Just a small update on POG1's lines. RewriteRule .*\.(jpe?g|gif|png|bmp)$ - [F] Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.