SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Addict jlisec01's Avatar
    Join Date
    Nov 2006
    Location
    MI
    Posts
    324
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Quick Question Using CGI / Perl

    Hi, I just had 1 question, for this here, the images folder is in the cgi directory with the cgi file but the images don't display... any ideals? thanks.

    Code Perl:
    sub create_acknowledgment_page {
    print <<END_HTML;
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
     <head>
       <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
       <title>Comment has been Submitted</title>
       <style type="text/css">
         #header { float: left; }
       </style>
     </head>
     <body>
       <img src="images/apache-hdr-logo.jpg">
       <img src="images/apache-hdr-waterfall.gif">
     </body>
    </html>
    END_HTML
    }

  2. #2
    SitePoint Evangelist
    Join Date
    Jun 2007
    Location
    North Yorkshire, UK
    Posts
    483
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you put the url for one of the images in you browser address bar does the image display.

    If it doesn't then that is the problem, the fact that the html page is being generated by a perl script is irrelevant.

  3. #3
    SitePoint Addict jlisec01's Avatar
    Join Date
    Nov 2006
    Location
    MI
    Posts
    324
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by PhilipToop View Post
    If you put the url for one of the images in you browser address bar does the image display.

    If it doesn't then that is the problem, the fact that the html page is being generated by a perl script is irrelevant.
    yea, the images do display. idk what my exact problem could be

  4. #4
    om nom nom nom Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,233
    Mentioned
    47 Post(s)
    Tagged
    1 Thread(s)
    Possibly the relative url is still not good: the url you use should be in relation to where Perl is putting/making this HTML file.

    For instance, if the HTML file is in public_html and the images folder is next to (not inside) public_html, then the HTML file needs to call the images as
    ../images/imagename.png
    where ../ goes up a level (out of public_html) before going into images.

    Disregard all of the above if you're letting Apache do any mod_rewrite...

  5. #5
    SitePoint Addict jlisec01's Avatar
    Join Date
    Nov 2006
    Location
    MI
    Posts
    324
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Stomme poes View Post
    Possibly the relative url is still not good: the url you use should be in relation to where Perl is putting/making this HTML file.

    For instance, if the HTML file is in public_html and the images folder is next to (not inside) public_html, then the HTML file needs to call the images as
    ../images/imagename.png
    where ../ goes up a level (out of public_html) before going into images.

    Disregard all of the above if you're letting Apache do any mod_rewrite...
    that cgi script that I have, has several functions and its all based pretty much on validation. if the form fields are empty send a error page else process through. the other function that i have is identical code but the only difference is that it says error please go back. however for the other function if i use that path it works, the images do display, but this other identical function doesn't. idk if im missing something big here or not.

  6. #6
    SitePoint Addict jlisec01's Avatar
    Join Date
    Nov 2006
    Location
    MI
    Posts
    324
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yea its weird, i might have to get rid of that one function because it doesn't want to display any images.... in the other functions the path is perfect.

  7. #7
    Utopia, Inc. silver trophy
    ScallioXTX's Avatar
    Join Date
    Aug 2008
    Location
    The Netherlands
    Posts
    8,892
    Mentioned
    138 Post(s)
    Tagged
    2 Thread(s)
    If you're using Internet Explorer to view the page it might be the JPEG files are stored using the CMKY color profile. IE doesn't display those images.
    If you're not using IE, or, if the same images do show up on other pages then I haven't a clue.
    Rémon - Hosting Advisor

    Minimal Bookmarks Tree
    My Google Chrome extension: browsing bookmarks made easy

  8. #8
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    16,426
    Mentioned
    160 Post(s)
    Tagged
    1 Thread(s)
    You can determine if it's a path (or mod-rewrite?) or image problem by changing the relative path to an absolute path.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •