Poland Spring
New member
I found a script that will automatically generate thumbnails when the image is put in a directory.
My website is a subdirectory. It looks like this: http://example.com/Clubs/subdirectory. So when the images are uploaded, I expect for the image path to look like this: http://example.com/Clubs/directory/imagelocation/image.jpg
However, when I check the path of the images (the images are broken), it looks like this: http://example.com/imagelocation/non-existent directory/image.jpg
This was the script used:
session_start();
session_cache_limiter();
error_reporting(0);
include "FWcgen.inc";
$picturedir = $_GET['dir'];
$strtdir = getcwd();
$ch = chdir ($picturedir);
$myhost = $_SERVER['HTTP_HOST'];
if ($ch) include "FWcgen.inc";
$mydir = getcwd();
$tmp = chdir ($strtdir);
I don't have any experience with PHP, but I think the issue is with: $myhost = $_SERVER['HTTP_HOST'];
where HTTP_HOST directs me to the root of the site. How can I change it so that it will direct it to where it should go? I have tried replacing HTTP_HOST with DOCUMENT_ROOT, but that generated an error....
Help is greatly appreciated, if anything is unclear please let me know.
Thanks in advance.
My website is a subdirectory. It looks like this: http://example.com/Clubs/subdirectory. So when the images are uploaded, I expect for the image path to look like this: http://example.com/Clubs/directory/imagelocation/image.jpg
However, when I check the path of the images (the images are broken), it looks like this: http://example.com/imagelocation/non-existent directory/image.jpg
This was the script used:
session_start();
session_cache_limiter();
error_reporting(0);
include "FWcgen.inc";
$picturedir = $_GET['dir'];
$strtdir = getcwd();
$ch = chdir ($picturedir);
$myhost = $_SERVER['HTTP_HOST'];
if ($ch) include "FWcgen.inc";
$mydir = getcwd();
$tmp = chdir ($strtdir);
I don't have any experience with PHP, but I think the issue is with: $myhost = $_SERVER['HTTP_HOST'];
where HTTP_HOST directs me to the root of the site. How can I change it so that it will direct it to where it should go? I have tried replacing HTTP_HOST with DOCUMENT_ROOT, but that generated an error....
Help is greatly appreciated, if anything is unclear please let me know.
Thanks in advance.