it produces a open/save window, no image in web browser if i run security_image.php but if i run the webpage then image does not load if that is any help. I can upload the other source codes if thats any help ? but could it be anything to do with i am running the page on the computer and not actual sever with the files being the server side code ?
You are using security_image.php as the SRC attribute in an IMG tag. If it does not produce an image as output, the browser cannot display an image. So you first have to find out why security_image.php does not generate an image. Maybe your server is configured to serve php files always as text/html and somehow overrides the header() call in this file.