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'])) {

Did you know?Explore Trending and Topic pages for more stories like this.
//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

question about stripslashes and real_escape_string
im cleaning up an old app that I wrote fixing some of the vulernabilities from attacks.

I hav

Question about ShowWindow()
Hello....

I'm struggling with sumpin, and I hope y'all can help.

I've got a CFormView

PHP Form to Variable.
Hi! I have written a HTML-form code in DreamWeaver CS3 (in a PHP doc) and I really need it to work s

VAT
how should I deal with VAT?

if I have a product that costs £5.00 and VAT @ 17.5% (£0.87

ORA-00932: inconsistent datatypes: expected - got CLOB
SO : windows xp
database : XE

there is a table (transito) with two fields of clob

Displaying different page content, depending on the logged in user.
Hi all, I am new to ASP.net (and web development in general), and have a question about how I can di

Procedure with variable number of columns
Hi, I have a procedure that looks like this:

PROCEDURE PROC(p_cursor OUT sys_refcurso

update post issues
I am trying to create an update to a post function, while the update does occur, the page routing an

rookie looking for help coding a CSS form with PHP
I'm trying to figure out how to add PHP code to my xhtml form so that it is a working form embedded

Had a simple form script that suddenly stopped working
It was made about a year ago and had been working fine. Last time it was known to work for sure was

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