Dear Brian
It seems that you are not really familiar with HTML... I try to explain:
a tag is "<whatever>"... so a correct image-tag is: "<img src="images/anything.gif">"
This is plain HTML so far....
You have to put this img-tag into your so-called main-file -> there where you want to display all the informations AND the picture.
As you need a script to grab the correct picture you can't just use "<img src="path/to/picture.gif">. To solve your problem, use: <img src="script.php">.
You even can give any parameters along the scriptname. i.e. <img src="script.php?person_id=<? echo $person_id;?>">
(which would result in <img src="script.php?person_id=23"> assuming 23 is the current value when the main file was executed)
Let's talk about basic HTML and server processing...
Let's assume you point your browser to a webpage which contains 1 picture. That's what's going on until you see the whole page including the picture:
- browsers searches page on specific server
- server sends file (HTML) to browser
- browser parses HTML-Code and displays Page
- browser recognized the img-tag and sends another request to server:
- browsers sends request to transfer picture
- server sends picture
- browser implements picture into page.
Everything ok so far?
The second request (picture) in detail:
The browser parses the HTML-Code which he gets from the server (first request). When the browser finds a <img src="path/to/whatever.gif"> the request is: Server, send me "path/to/whateverfile.ext". No matter if whateverfile.ext is a valid picture-File.
If the File transmitted by the second request IS a valid picture File (see below), the browser places it into the page where the img-tag was found.
(here is below) 🙂
It is actually NOT the extension itself that makes a file to a valid picture-File! Every file transmitted has got it's own so-called "header". This header information says what the content of the file should be treated as - NOT THE EXTENSION.
With the header-command in the script.php (described approx. 1 hour ago...) you make the output of that script to be interpreted as a (valid) gif File, altough it has the extension .php.
So assuming you want to display some data about a person AND its picture, you have to add the code for retrieving all the information (except the picture) in your MAIN-File.
To retreive the picture you have to have your script.php executed (which ftp's to whereever and streams the picture as output). This is easily done by adding the image-tag "<img src="script.php"> in the MAIN-File whereever the picture should be placed.
I hope I cleared any missunderstandings...
anyway.. I'm off now (midnight here).
Good look