Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

Re: Re: Random Imaging

by appex32 (Initiate)
on Aug 01, 2003 at 15:40 UTC ( [id://280008]=note: print w/replies, xml ) Need Help??

in reply to Re: Random Imaging
in thread Random Imaging

I don't understand how I'm generating all this horrible html code, when the only problem I seem to have is that the picture is not displayed. If you want to see what comes up go here:

Replies are listed 'Best First'.
Re: Re: Re: Random Imaging
by alienhuman (Pilgrim) on Aug 01, 2003 at 17:13 UTC

    The problem is that you are populating your IMG tags with this path:

    /htdocs/pics/{random image file}

    However, your pics are here:

    http://{your site IP}/pics/{random image file}

    Without knowing your filesystem, it's hard to say exactly where, but somewhere you are introducing "/htdocs/" to the path. My guess is the "./" part of the path, but you've said changing that has no effect.

    Off the top of my head: could this be a config issue with your server? Perhaps you are pointing at the directory above your docroot (ie htdocs) instead of the htdocs directory?


    Update: I copy/pasted your code and ran it on my machine. When I removed the "." before the "./pics" it worked. If you do that and you are still getting "/htdocs/pics" I'd say it's almost certainly a config issue.

      Do you mean the code that I originally posted or the code that you gave me? Cause I got the code that I wrote working. It turns out it was a problem with my server configuration, just a little typographical error that threw it off.
      Yeah i did figure out what the problem was, I had a stupid gramatical error in the config file of the server. Although the code i have may not be the greatest, according to some, it did work correctly once i fixed that config error. Thanks for your help.
Re: Re: Re: Random Imaging
by Cine (Friar) on Aug 01, 2003 at 15:52 UTC
    I don't understand how I'm generating all this horrible html code
    No that is obvious.
    when the only problem I seem to have is that the picture is not displayed
    Looks can be deceiving.
    But your problem is obvious, you dont have a directory called /pics on your webserver, yet that is the link you send to the browser! It does seem you have a /cgi-bin/pics/ but that tries to execute the image as a cgi-script, which does not go well.

    T I M T O W T D I
      I see. So you're saying that the way I have the program now it is not recognizing the image files as images but rather as cgi scripts, and to remedy that I have to do it the way that you did which is actually read the images in and place them into an array? Also, if I say that I don't understand how I'm doing something, that means I don't and its not obvious to me, no matter how obvious it is to you or anyone else.
        No! I am saying just the opposite!
        Your images ARE recognizing as cgi-scripts right now, they should obviously be seen as images!
        And, then secondly, I dont even check if you images exists, let alone read them in. I really cant see where that idea came from?
        Move your pics library from the cgi-bin dir to the .../htdocs, give it permission for everyone to read chmod 755 pics; chmod -R 644 pics; and then it should work.
        Then go read a introduction to HTML and HTTP, and try to understand why it went wrong.

        T I M T O W T D I

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://280008]
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (2)
As of 2024-04-21 20:52 GMT
Find Nodes?
    Voting Booth?

    No recent polls found