08-17-2005
unable to view the output through this cgi
#!/bin/env perl
read(STDIN,$temp,$ENV{'CONTENT_LENGTH'});
@pairs=split(/&/,$temp);
$DISPLAY1 = "/u/inarram111/dev/web/HNW/BNY/unsecure-html/myscript2.html";
$DATAFILE1 = "/u/inarram111/dev/web/HNW/BNY/unsecure-cgi-bin/datafile";
open (DATAFILE1, ">$DATAFILE1") || die " Error opening log file AFILE1.\n";
foreach $item(@pairs)
{
($key,$content)=split(/=/,$item,2);
$content=~tr/+/ /;
$content=~s/%(..)/pack("c",hex($1))/ge;
$fields{$key}=$content;
print DATAFILE1 "$content\n";
}
close (DATAFILE1);
open (DISPLAY1,">$DISPLAY1") || die " Error opening log file $DISPLAY.\n";
open (DATAFILE1, "<$DATAFILE1") || die " Error opening log file DATAFILE2.\n";
print DISPLAY1 "<HTML>\n";
print DISPLAY1 "<BODY>\n";
print DISPLAY1 "<FORM METHOD=\"POST\" ACTION=\"/cgi/myscript2.cgi\">\n";
print DISPLAY1 "<PRE>\n";
print DISPLAY1 " <b> Typed Message </b>\n";
print DISPLAY1 " <br>\n";
print DISPLAY1 " <TEXTAREA NAME=\"display\" ROWS=\"7\" COLS=\"45\">\n";
foreach $cur_line (<DATAFILE1>)
{
chomp $cur_line;
print DISPLAY1 "$cur_line";
}
print DISPLAY1 " </TEXTAREA>\n";
print DISPLAY1 " <b> Type Message </b>\n";
print DISPLAY1 " <br>\n";
print DISPLAY1 " <TEXTAREA NAME=\"display1\" ROWS=\"7\" COLS=\"45\">\n";
print DISPLAY1 " </TEXTAREA>\n";
print DISPLAY1 " <INPUT TYPE=\"submit\" VALUE=\"Send!\"> <INPUT TYPE=\"reset\" value=\" Clear\">\n";
print DISPLAY1 "</PRE>\n";
print DISPLAY1 "</FORM>\n";
print DISPLAY1 "</BODY>\n";
print DISPLAY1 "</HTML>\n";
close (DISPLAY1);
open (DISPLAY1,"<$DISPLAY1") || die " Error opening log file $DISPLAY.\n";
@list = <DISPLAY1>;
close (DISPLAY1);
print "Content-type: text/html\n\n";
print "@list";
the out put is page cannot be displayed.... pls help out....
9 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi, first post here be gentle. Very new to Unix. Using HP-UX 10.20
I CD into a remote directory on one machine
$ cd /net/remote hostname
yet when I do an ll in this directory none of the contents appear. It just is empty.
when I do the same command from another machine,
$ cd... (13 Replies)
Discussion started by: maddave
13 Replies
2. Solaris
Hi,
I want to run pkg something called SUNWexplorer and find the output.
Where i can find the pkg? (1 Reply)
Discussion started by: Renjesh
1 Replies
3. Linux
Hi Everybody,
I am Unable to view files in a particular directory under /opt. But, when I reboot the server, I am able to view the files.. Its happening daily. Do u 've n e answers/suggestions.
Kindly help..
:confused: (1 Reply)
Discussion started by: its.simron
1 Replies
4. UNIX for Dummies Questions & Answers
Hi Everybody,
I am Unable to view files in a particular directory under /opt. But, when I reboot the server, I am able to view the files.. Its happening daily. Do u 've n e answers/suggestions.
Kindly help..
:eek: (1 Reply)
Discussion started by: its.simron
1 Replies
5. Shell Programming and Scripting
Hi Moderator,
I am not able to view my post
Shell Programming and Scripting - The UNIX and Linux Forums
7 Hours Ago by scottn · Go to last post · 2, 43. Encryption of card number ( Multi-page thread 1 2). mad_man12. 8 Hours Ago by Corona688 · Go to last post ...
Please Advice (1 Reply)
Discussion started by: mad_man12
1 Replies
6. Shell Programming and Scripting
It is a basic Perl CGI question, I want to print out "Processing ... " while backend script /script/wait.pl is still running.
But acctually, nothing appeared in browser untill /script/wait.pl finished.
print "Content-type:text/html\r\n\r\n";
print '<html>';
print '<head>';
print... (4 Replies)
Discussion started by: honglus
4 Replies
7. Red Hat
Hi
I am unable to view the output of sar file using below command
sar -f sar07, it is showing below error.
Invalid system activity file: sar07 (0x920)
above file is in location /var/log/sa
wheather for memory it is creating the file at different location? (1 Reply)
Discussion started by: manoj.solaris
1 Replies
8. Shell Programming and Scripting
Hi All,
I have written an cgi perl script that displays an image(Excel image) and when clicked on that Image I need to download a excel sheet.
I made sure that excel sheet exists in the folder with the given name but still I am not able to download the sheet.
print "<center><table... (2 Replies)
Discussion started by: scriptscript
2 Replies
9. Shell Programming and Scripting
hi folks,
I am trying to download xlsx from cgi page in browser but not sure where I made a mistake.
the cgi script contains the code for creating xlsx and just by clicking on the image I should be able to
#!/usr/bin/perl -w
use Excel::Writer::XLSX;
use DBI;
use DBD::mysql;
use CGI;... (1 Reply)
Discussion started by: scriptscript
1 Replies
LEARN ABOUT REDHAT
upsstats.cgi
upsstats.cgi(8) Network UPS Tools (NUT) upsstats.cgi(8)
NAME
upsstats.cgi - Web-based UPS status viewer
SYNOPSIS
upsstats.cgi
NOTE
As a CGI program, this should be invoked through your web server. If you run it from the command line, it will either complain about unau-
thorized access or spew a bunch of HTML at you.
DESCRIPTION
upsstats.cgi uses template files to build web pages containing status information from UPS hardware. It can repeat sections of those tem-
plate files to monitor several UPSes simultaneously, or focus on a single UPS.
These templates can also include references to upsimage.cgi(8) for graphical displays of battery charge levels, voltage readings, and the
UPS load.
ACCESS CONTROL
upsstats will only talk to upsd(8) servers that have been defined in your hosts.conf(5). If it complains that "Access to that host is not
authorized", check that file first.
TEMPLATES
The web page that is displayed is actually a template containing commands to upsstats which are replaced by status information. The
default file used for the overview is upsstats.html.
When monitoring a single UPS, the file displayed is upsstats-single.html.
The format of these files, including the possible commands, is documented in upsstats.html(5).
FILES
hosts.conf(5) upsstats.html(5)
SEE ALSO
upsimage.cgi(8)
Internet resources:
The NUT (Network UPS Tools) home page: http://www.exploits.org/nut/
NUT mailing list archives and information: http://lists.exploits.org/
Mon Sep 2 2002 upsstats.cgi(8)