images aren't rendering


Posted on 16th Feb 2014 07:03 pm by admin

I'm trying to call a JPG file from within PHP (in an effort to hide the actual JPG folder). The image is supposed to be called at domain.com/photo/?id=X&i=Y where X is the gallery ID and Y is the image number, but it doesn't seem to be working. I've done this before but copying and pasting the code doesn't seem to be working. What am I missing?

Code: [Select] if (isset($_GET['id']) && isset($_GET['i'])) {

//get folder location of photos
$gallery_path = mhp_get_gallery_filepath($_GET['id']).'/';

//return filenames of all jpgs in folder
$imgs = (mhp_img_list($gallery_path));

//get name of i-th jpg file
$img = $imgs[(int) $_GET['i']];

//check to see if the image exists
if (file_exists($gallery_path.$img) && is_readable($gallery_path.$img) && getimagesize($gallery_path.$img)) {
header('Content-Type: image/jpeg');
$orgimage = imagecreatefromjpeg($gallery_path.$img);
imagejpeg($orgimage, NULL, 90);
imagedestroy($origimage);
}

}

No comments posted yet

Your Answer:

Login to answer
55 Like 36 Dislike
Previous forums Next forums
Other forums

Two fgetcsv related questions ;D
First of im trying to get a file from a merchants server but the directory is protected, I know the

UPLOAD IMAGES NOT WORKING!
Hi there i have a upload script in which it uploads the picture to a folder than creates two thumbna

Help With editting and deleting form
Hallo !!

So look at this image :

http://img194.imageshack.us/img194/8272/snapshot5f.pn

Cannot Connect to Database
I am writing an application to do annual reviews. I cannot get my script to work. Whenever it runs I

Will this protect from mysql injection?
I do not want anything like DROP TABLE to work or any type of coding..

Heres my code.. is it

rename the file
File.txt

Code: ***DOCUMENT***
..DN:
000044255
..CB:
..SN:
..PY:
2009
..E

Preg_match with an array
is there an away to use preg_match with an array?

i want to check a string with an array to s

Extracting Long text from message class with parameters
Hi,

I would like to extract the long text from a message class. However, the long text ha

Warehouse Management
Hi,

On our system, we have two storage locations ( A and B ) where A is the main factory

Code error with Index.php
Error: Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/runevid/public_

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash