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);
}
}
j1inmis Ouput layout changes
Hi,
Need help in log in and log out?
hi there all of u. i have recently created a site for someone. i have placed log in and log out and some links . but those sessions are not working correctly when some one sign in and sign out and
help with php
It's not displaying or pulling anything out of the database. Code: <html><head><title>Hale's Music World: Inventory Search
Printing a webpage
I use this to print the webpage:
Help on code output
My CODE:Code: [Select] echo "<phone>".$line["phone"]."</phone>"; echo
Weird MySQL error, why am I recieving this?
PHP Code:<?php require "global_settings.php"; ?><title><?php echo $sitetitle; ?></title><center><style
Extending Exception to contain method name
I was wondering, if there's a way to extend Exception in such a way, that it would contain name of a method where it has been thrown.Right now I have this:class myException extends Exception {
Any help with my email script?
I have an email script, I have not tested it, although someone tested it for me and said it worked fine. I started to make modifications to the code after using the basic structure. This is my HTML
xml element exists
Code: [Select]<?xml version="1.0"?><Addresses> <Address ID="1"> <Address2>101 MAIN ST</Address2>
unexpected T_VARIABLE error
Hey all! I'm getting an unexpected T_VARIABLE with the following function:function getHighestParentName($id = $this->cid){ $cat = mysql_fetch_assoc(fsquery('getParentCategories', $id));