I made the corrections per the last two postings, but still nothing but a broken link for the image.
If I just run temp2.php (I set $image=1 as if it were being passed from temp.html) it works fine.
This makes me think that when I run temp.html (and it is supposed to call temp2.php) it isn't really doing it. I'll mess up the SQL code on purpose to see if I get an error... and I don't get any errors.
The two files look like this:
- temp.html
<html>
<body>
Here is your picture:<br>
<img src="temp2.php?imgnum=1"><br />
</body>
</html>
- temp2.php
<?php
$image = $_GET['imgnum'];
$host="x.x.x.192";
$user="xxxxxx";
$password="xxxxxxx";
$db="spjp";
$cxn = mysql_connect($host,$user,$password)
or die ("Couldn't connect to server");
$dbselected = mysql_select_db($db)
or die("Couldn't select db");
$query = "SELECT filename FROM img_tbl WHERE index_fn=" . intval($image);
$result = mysql_query($query);
// Send the content-type header for JPG
header('Content-Type:image/jpeg');
mysql_result($result, 0,'filename');
?>
Thanks for the help