image

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??

LVL 1
shahrahulbAsked:
Who is Participating?
 
divtConnect With a Mentor Commented:

shahrahulb,

I suspect that this issue was caused by variable scope.  You can try one of these 2 methods to fix it:

METHOD 1 - expressly define the variable scope

use CONFIG;
our $IMAGE;

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>
";



or METHOD 2 - do not declare $IMAGE in CONFIG.pm and make the variable local


$IMAGE = "/v/blah.com/ast/images";
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>
";



Good luck!
0
 
shahrahulbAuthor Commented:
if the image is present in  /v/blah.com/ast/www/oos

and if i use  BACKGROUND = $CONFIG::IMAGE/1pixelwidth.gif

then it works fine

but i wantto store all my images in sepertae directory
0
 
infexConnect With a Mentor Commented:
You should define this directory as a virtual internet directory (allow web sharing) and give read access.

In the http:// you should refer to that virtual path.

virtual directory :

right click on the directory, choose properties, web sharing, share this folder.

Hope this helps
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.