unable to view the output through this cgi


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers unable to view the output through this cgi
# 1  
Old 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....
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Unable to create spreadsheet in cgi script

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

2. Shell Programming and Scripting

Perl CGI : unable to download the excel sheet from perl cgi page

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

3. Red Hat

Unable to view output of Sar File for memory

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

4. Shell Programming and Scripting

Perl CGI. no output until backend script is done

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

5. Shell Programming and Scripting

Unable to view my post submitted 4 days ago

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. UNIX for Dummies Questions & Answers

Unable to view files in a particular directory under /opt

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

7. Linux

Unable to view files in a particular directory under /opt

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

8. Solaris

how to view explorer output in 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

9. UNIX for Dummies Questions & Answers

Unable to view contents of a directory

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
Login or Register to Ask a Question