473,396 Members | 1,929 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How to display the JPEG image using PERL with HTML?

147 100+
Hi,

I am running Apache and the Active Perl. In Apache, CGI folder, i had one JPEG image. I wants to display this JPEG image in my browser as the header.

Expand|Select|Wrap|Line Numbers
  1. use CGI qw(:all);
  2. print "Content-type: text/html\n\n";
  3. print "<body bgcolor="FFFF">;
  4. print "<img src=\cgi-bin\header.jpg>";
  5. print "</body>;
  6. print "</html>;
  7.  
when i run this program, i can't able to see the image, its just showing small cross icon. My image path is correct.Showing background color. I don't know, whats a problem.



Thanks in Advance
Feb 8 '11 #1
2 6039
numberwhun
3,509 Expert Mod 2GB
Try taking the images out of the cgi-bin folder. That should be reserved specifically for cgi scripts. In your web root for the site, create an images or pics folder and reference that instead and see if it works.

This isn't so much a Perl issue as it is an HTML path to image issue.

Also, considering you have over 100 posts, this is your only warning.... Please use CODE TAGS around code you post in the forums!
Feb 8 '11 #2
miller
1,089 Expert 1GB
Your problem is in this line:
Expand|Select|Wrap|Line Numbers
  1. print "<img src=\cgi-bin\header.jpg>";
That will become <img src=i-binheader.jpg> because you aren't escaping your backslashes. However, since this is html, you probably want forward slashes anyway.
Expand|Select|Wrap|Line Numbers
  1. print "<img src=/cgi-bin/header.jpg>";
- Miller
Feb 8 '11 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Sergiusz Michalski | last post by:
Hallo! Is it possible to get image using XMLHTTP and display it on WWW ?? All secury lack solutions are needless so ADODB.Stream won't be a right way! Thanks for help! SM.
1
by: bborden | last post by:
Novice Access programmer here. I would like to display an image using the Toolbox Image object by calling the images file name using: =fPictureFiles(!!,1) in the Picture control. Below...
0
by: MattB | last post by:
I receive a dataset from a COM component that contains a jpeg image. I'm having trouble making the image display based on any examples I've found, and the trouble seems to be that the field type is...
1
by: lalithabhamidi | last post by:
I am trying to display an image using MagickimageDisplay using C API. But it asks for X server.So i am unable to display my image. Any Suggestions??
12
by: Speed | last post by:
Hi, Could you please tell me what is the simplest code to read a 8-bit grayscale JPEG using C++? Thanks a ton, Speed.
10
by: Speed | last post by:
Hi, Could anyone tell me what is the simplest code to read a 8-bit grayscale JPEG image using C. Thanks a ton, Speed
3
by: computer_guy | last post by:
Hi Everyone, I run into a problem. I am trying to write an aspx that can dynamically generate an image based on some input parameters. Things are very simple if the size of the parameters is...
1
underscore
by: underscore | last post by:
i use a php4 and apache2.0 b4 with mysql4 or lower in my php program. when i use xampp every i can't view my stored image already in html... here's my code. <?php $db_server ="Localhost";...
2
by: ranjeshh | last post by:
How do I display a jpeg image using c..Please gude me as I m new to image processing..I would appreciate if someone could give me a working code with explanation
5
by: RuiT | last post by:
Hello, I'm uploading images to a folder and I want to display each new image on a web page every time it is saved in the folder. I can display the initial image, which is already in the folder,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.