Jump to content

Recommended Posts

I'm working on creating a gallery script. It calls up a database file and finds out what thumbnail to use in selecting a gallery, then displays it. The thumbnails should be kept in gallery/gal_th/image.jpg. They aren't showing. First I had this:

 

echo "<td><img src=\"./gal_th/$gal_arr[0]\">

 

Then:

 

$gal_th = "./gal_th/" . $gal_arr[0];

echo "<td><img src=\"$gal_th\">

 

Then:

 

echo "<td><img src=\"./gal_th/people.jpg">

 

Then:

echo "<td><img src=\"http://www.kgpnet.net/kgpphoto2/gallery/gal_th/people.jpg\">

 

So, I think I've used every way to call the image I can. In each I case I checked properties on the image; the script is finding the image name, but is ignoring the directory gal_th. Even when I put the absolute path it was ignored, as though I had only put the filename. Any ideas why?

 

Here's the script up to that point:

 

//First, let's get the options.
include './db/settings.db';
//In case there are rows, we offset to check which will be new, not the end

//This tells us we haven't done anything yet.
$set = 1;
//First, we need to choose a gallery. Let's find the data:

$gal_file = file("./db/gals.db");
//Now we list in sets, names without descriptions, depending on settings.
if($mode == "grid"){
foreach($gal_file as $gal_line){
	$gal_arr = explode("|",$gal_line);
	$gal_th = "./gal_th/" . $gal_arr[0];
if($set == "1"){
	echo "<table><cellspaceing=\"6\"><tr><td><img src=\"http://www.kgpnet.net/kgpphoto2/gallery/gal_th/people.jpg\">
		<br>
		$gal_arr[1]</td>";
	}

Link to comment
https://forums.phpfreaks.com/topic/69529-solved-path-ignored/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.