shahrahulb
asked on
cgi
i have a directory structure:
/v/blah.com/ast/
ls -l gives 3 directory
images
data
www
if we go to www and ls -l i have
/www/oos/oos.cgi
in my cgi script
use CONFIG;
print" <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" bgcolor=\"#3399CC\" width=\"100%\" height=\"60\">
<tr>
<td colspan=\"2\" BACKGROUND = $CONFIG::IMAGE/1pixelwidth .gif id=\"fillbgtop\"><IMG height=25 src=http://www.xyz.com/images/clear.gif border=0></td>
</tr>
</table>
";
it is not abe to read imgae $CONFIG::IMAGE/1pixelwidth .gif
CONFIG.pm contains
our $IMAGE = "/v/blah.com/ast/images
why??
/v/blah.com/ast/
ls -l gives 3 directory
images
data
www
if we go to www and ls -l i have
/www/oos/oos.cgi
in my cgi script
use CONFIG;
print" <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" bgcolor=\"#3399CC\" width=\"100%\" height=\"60\">
<tr>
<td colspan=\"2\" BACKGROUND = $CONFIG::IMAGE/1pixelwidth
</tr>
</table>
";
it is not abe to read imgae $CONFIG::IMAGE/1pixelwidth
CONFIG.pm contains
our $IMAGE = "/v/blah.com/ast/images
why??
what is DocuemtRoot of your server?
You are confusing directory paths with URL paths.
/v/blah.com/ast/images is the path on the server. In almost all cases, this is not the same path that is used to access an image in that directory via the webserver.
At a guess, you should set
$IMAGE = 'images';
Assuming of course, that the images directory is within your Document Root or has be set up with an alias.
/v/blah.com/ast/images is the path on the server. In almost all cases, this is not the same path that is used to access an image in that directory via the webserver.
At a guess, you should set
$IMAGE = 'images';
Assuming of course, that the images directory is within your Document Root or has be set up with an alias.
ASKER
only the image is not working
if i use
my $c = File::CounterFile->new("$C ONFIG::DAT A/$file"); in my cgi script
this works fine
CONFIG.pm contains: our DATA = "/v/blah.com/ast/data"
if i use
my $c = File::CounterFile->new("$C
this works fine
CONFIG.pm contains: our DATA = "/v/blah.com/ast/data"
Did you update the setting for $CONFIG::IMAGE as suggested?
What URL do you use the view the image in your browser? Once you know that, you have the image path you need to use. I think you will probably just need to set it to '/images'
What URL do you use the view the image in your browser? Once you know that, you have the image path you need to use. I think you will probably just need to set it to '/images'
ASKER
url is http://blah.com/oosui/oos-ui.cgi
location of oos-ui.cgi = /v/blah.com/ast/www/oosui/
location of images = /v/blah.com/ast/images
ASKER
DocumentRoot /v/blah.com/ast/www
mv /v/blah.com/ast/images /v/blah.com/ast/www/oosui/ images
then in CONFIG.pm:
our $IMAGE = "/v/blah.com/ast/www/oosui /images"
then in CONFIG.pm:
our $IMAGE = "/v/blah.com/ast/www/oosui
ASKER
i know this already but i want to seperate my image file from oosui directory
Unless you change your webserver configuration, you will need to move your images under your document root, otherwise they will not be viewable.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
and if i use BACKGROUND = $CONFIG::IMAGE/1pixelwidth
then it works fine
but i wantto store all my images in sepertae directory