tags:

views:

69

answers:

1

hello, i use a script for my image.php.. the url with an image looks like this:

/image.php?title=Alyssa Milano Unicef&description=Alyssa Milano Unicef&url=uploads/2009/12/alyssa_milano_unicef_05.jpg

But if someone types directly www.site.com/image.php it shows a blank site.. a redirection would be nice, to the 404page or startpage.. i know it must something like "if else".. if image - then show the page.. if there no pic go to 404 or the startpage.. thank your for helping!

A: 

It should be a 403 instead of 404. Try:

//if no image
header('HTTP/1.0 403 Forbidden');
header('Location: http://www.site.com/imagebrowser.php');

You could also set up imagebrowser under image.php

erenon