LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-23-2005, 01:06 PM   #1
Barca
LQ Newbie
 
Registered: Nov 2004
Location: Poland
Distribution: Slackware - best and only ;]
Posts: 29

Rep: Reputation: 15
How to show image in CGI script?


Hello
I have idea about writing CGI script which would scan LAN for live hosts (arping will be helpful) and show monitors images showing status of every host (monitor turned off - host turned off and monitor turned on - host turned on). Simply, but I couldn't find one thing, how to show mages (gifs, jpgs etc. - no dynamically created lines or sth like this) in CGI scripts. Any help will be truely appreciated

//edit
Found it

#!/usr/bin/perl
#print "Content-type: text/plain\n\n";
print "Location: http://www.microsoft.com/secret_picture_of_bill.jpg\n\n";

Sorry for bothering

Last edited by Barca; 07-23-2005 at 02:53 PM.
 
Old 07-23-2005, 03:38 PM   #2
Barca
LQ Newbie
 
Registered: Nov 2004
Location: Poland
Distribution: Slackware - best and only ;]
Posts: 29

Original Poster
Rep: Reputation: 15
One question I can only show image in this file :/ How to write script, which will do sth (e.x. print text, display forms etc.) and show image?

//edit
It's strange, but today I can reply to myself

#!/usr/bin/perl
print "Content-type: text/html\n\n";
print "It's my picture:\n";
print "<img src=\"http://mysite.com\/my_dir\/my_image.jpg\">\n";
print "";


Last edited by Barca; 07-23-2005 at 04:35 PM.
 
Old 07-23-2005, 05:22 PM   #3
rose_bud4201
Member
 
Registered: Aug 2002
Location: St Louis, MO
Distribution: Xubuntu, RHEL, Solaris 10
Posts: 929

Rep: Reputation: 30
Hehe, I do that a lot too Sometimes just talking the problem out to yourself helps to solve it!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Directory listing - Calling shell script from a CGI script seran Programming 6 08-11-2005 11:08 PM
python cgi script and premature end of script headers Neruocomp Programming 1 07-28-2005 11:43 AM
svg image doesn't show up in the browser eantoranz Programming 1 11-24-2004 12:28 PM
KSEARCH cgi script itloser Linux - General 0 02-20-2003 09:20 AM
Protect a CGI Script? LiveMatter Programming 13 09-24-2002 08:41 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:05 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration