CGI
Hi all,
I have a program that gets its images from a mysql database. I pass a string to the program that gets the picture inside an HTML image tag like this:
<*img src=\"show_image.php/thumbnails/$boxData[t hum_id]/img.jpg\">
This is what the string looks like when it has been passed:
show_image.php/thumbnails/7678/img.jpg
This is the program show_image.php
The functions get_pic_id() and get_table_name() run a regex on the string and return the correct portions of the string that I then pass to get_file_data() and get the binary data.
I used to get the pic_id and the table_name from the $_GET string, but I wanted to force the browser to cache the images so a friend suggested using this. Thing is he wrote his version in Python which I dont know.
My question to you all is do you know if this possible and if so where can I get the string from?
I have a program that gets its images from a mysql database. I pass a string to the program that gets the picture inside an HTML image tag like this:
<*img src=\"show_image.php/thumbnails/$boxData[t
This is what the string looks like when it has been passed:
show_image.php/thumbnails/7678/img.jpg
This is the program show_image.php
$pic_id = get_pic_id($_SERVER['REQUEST_URI']);
$table_name = get_table_name($_SERVER['REQUEST_URI']);
$file_data = get_file_data($pic_id, $table_name);
header("Content-type: " . $file_data['type']);
echo $file_data['binary_data'];
The functions get_pic_id() and get_table_name() run a regex on the string and return the correct portions of the string that I then pass to get_file_data() and get the binary data.
I used to get the pic_id and the table_name from the $_GET string, but I wanted to force the browser to cache the images so a friend suggested using this. Thing is he wrote his version in Python which I dont know.
My question to you all is do you know if this possible and if so where can I get the string from?
