Page 2 of 2

Posted: Fri Apr 09, 2010 7:36 pm
by WebPhenom
Right - was just demonstrating what the Server Document Root did to the GET Folder. The absolute path that you showed does not work in the GET Folder and the end result is that it cant find anything and shows the No Image icon.

Posted: Fri Apr 09, 2010 8:16 pm
by WebPhenom
Also - i even tried it without trying to overwrite the defaults.


These settings do not work either and this is directly in the radim php code:

Code: Select all

*  See readme.htm file for further instructions!
*******************************************************************************/

/* The default folder with images */
$settings['img_folder'] = 'http://www.mysite.com/images/subpages/landscape/';

/* File types (extensions) to display */
$settings['img_ext'] = array('.jpg','.gif','.png');

This script seems to only work with relative links to the images folder, at least I could not find a way to make it work with absolute or root/site paths.

Seems like such a basic thing to have, surely there is a way.?

ALso if I just place an image tag with a root path it works, like this:

Code: Select all

<img src="/images/subpages/landscape/image011.jpg" alt="" width="350" height="150" border="0">
This works.

But this does not.

Code: Select all

<img src="<?php $_GET['folder']= 'images/subpages/landscape/'; include ($_SERVER['DOCUMENT_ROOT'] . "/includesPHP/randomimage.php"); ?>" width="350" height="150" alt="Random Image" />
So it must be in how PHP or the script is grabbing the location of the files on the windows server .

Posted: Sat Apr 10, 2010 11:40 am
by Klemen
The "img_folder" variable (or $_GET folder one) mustn't be an URL because if it's an URL then PHP can't read the folder for all image files inside.

Since the folder path is RELATIVE to the randim.php file with the setting you posted the randim.php will try to display images from this folder:
/includesPHP/images/subpages/landscape/

From what I understand your easiest solution might be simply to move the randim.php file to the "images" folder and then pass in the GET variables like
subpages/landscape/
subpages/landscape2/
subpages/someotherfolder/

If not, to be able to give a solution please post the exact URL where:

1. your randim.php file is
2. your images folder is
3. URL of the phpinfo.php file on your server:
http://www.phpjunkyard.com/extras/phpinfo.zip
4. two sample pages where you are using randim.php and the respective image sub-folders you are trying to include