View Single Post
Old Jan 4th, 2007, 3:51 PM   #11
PhilBon
Hobbyist Programmer
 
PhilBon's Avatar
 
Join Date: Nov 2005
Posts: 172
Rep Power: 4 PhilBon is on a distinguished road
Send a message via AIM to PhilBon Send a message via MSN to PhilBon
Here is an update: getimage.php
[php]
<?php
$path = "/home/philbon/public_html/pictures/" . $_REQUEST['id'] . ".jpg";
//$path = $_SERVER["DOCUMENT_ROOT"] . "/pictures/" . $_REQUEST['id'] . ".jpg";
header("Content-type: image/jpeg");
$fo = fopen($path, "r");
$img = fread($fo, filesize($path));
echo $img;
?>
[/php]
Here is a different version: getimagetn.php
[php]
<?
$id = $_REQUEST['id'];
header('Content-Type: image/jpeg');
echo file_get_contents("/home/philbon/public_html/pictures/tn/" . $id . ".jpg");
?>
[/php]
Once again here is what is code for the site:
[html]
Programming Forums: The image tag is right under this:<br />
<img src="http://www.philbon.com/getimage.php?id=3" /><br />
<img src="http://www.philbon.com/getimagetn.php?id=3" />
[/html]
Here are some links:
http://lucy.philbon.com/ or http://philbon.com/lucy/ Webpage I'm wanting the pictures to be displayed on.
http://www.philbon.com/getimagetn.php?id=3 file that is supposed to return the thumbnail of the image.
http://www.philbon.com/getimage.php?id=3 file that is supposed to return the image.
http://www.philbon.com/pictures/3.jpg Large image
http://www.philbon.com/pictures/tn/3.jpg Thumbnail image
@titaniumdecoy: Alright I've changed that so they are all relative. Even with the change I can't seem to get it to work

@Pizentios: The reason I want to use the middle man is because the script will later be turned into one that would be used for different users or different areas of a website. For example I have Philbon.com and then I have Web.PhilBon.com and Lucy.PhilBon.com, what will happen is to set it up where I don't have to put in all the different image links: philbon.com/images/ or lucy.philbon.com/images, but they can be stored in one location with a database back end to help manage them all. Another would be like for different photo albums, I can have one main page that gathers images from different areas of the site just by having one main link.
PhilBon is offline   Reply With Quote