limitphp Posted December 17, 2008 Share Posted December 17, 2008 I have a page artist.php?artistName=name I rewrite the url for this page so it looks like this: http://localhost/greckle/artist/James-Tucker-Band/ When they click on a page I take the artistName and match it against the database. Is there a way to make the page say Error 404 Page not found when the artistName doesn't match? In other words, when I run the query select * from artist where artistName = artistname if it doesn't match any records, is there a way to make the official error 404 page show instead of creating one that looks like it? or should I just create one that looks like it? thanks Quote Link to comment https://forums.phpfreaks.com/topic/137372-solved-force-error-404-when-querystring-match-not-found/ Share on other sites More sharing options...
ILMV Posted December 17, 2008 Share Posted December 17, 2008 This might help... saying that I have never used it good luck <?php header("HTTP/1.0 404 Not Found"); ?> http://uk2.php.net/header ILMV Quote Link to comment https://forums.phpfreaks.com/topic/137372-solved-force-error-404-when-querystring-match-not-found/#findComment-717740 Share on other sites More sharing options...
ILMV Posted December 17, 2008 Share Posted December 17, 2008 If that code itself doesn't work, then simply redirect using header to your 404 page. Quote Link to comment https://forums.phpfreaks.com/topic/137372-solved-force-error-404-when-querystring-match-not-found/#findComment-717743 Share on other sites More sharing options...
redarrow Posted December 17, 2008 Share Posted December 17, 2008 Really you need to create a nice error message, As a user might think your web site is down, or even your web site is crap, Be careful not everyone, No what the error messages mean.. So in essence create a nice error message with your header and footer included..... Quote Link to comment https://forums.phpfreaks.com/topic/137372-solved-force-error-404-when-querystring-match-not-found/#findComment-717745 Share on other sites More sharing options...
limitphp Posted December 17, 2008 Author Share Posted December 17, 2008 Really you need to create a nice error message, As a user might think your web site is down, or even your web site is crap, Be careful not everyone, No what the error messages mean.. So in essence create a nice error message with your header and footer included..... Oh yeah...Good point. So you think I should just say artist not found..... thanks guys. Quote Link to comment https://forums.phpfreaks.com/topic/137372-solved-force-error-404-when-querystring-match-not-found/#findComment-717751 Share on other sites More sharing options...
redarrow Posted December 17, 2008 Share Posted December 17, 2008 Yep, sounds good to me, with a header and footer your there...... Quote Link to comment https://forums.phpfreaks.com/topic/137372-solved-force-error-404-when-querystring-match-not-found/#findComment-717753 Share on other sites More sharing options...
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.