Sponsored Content
Top Forums UNIX for Dummies Questions & Answers unable to view the output through this cgi Post 81188 by rishchand on Wednesday 17th of August 2005 05:52:44 AM
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....
 

9 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

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. 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

7. 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

8. 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

9. 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
Ns_ConnCopy(3aolserver) 				   AOLserver Library Procedures 				   Ns_ConnCopy(3aolserver)

__________________________________________________________________________________________________________________________________________________

NAME
Ns_ConnCopyToChannel, Ns_ConnCopyToDString, Ns_ConnCopyToFd, Ns_ConnCopyToFile - Copy request content to open file or dstring SYNOPSIS
#include "ns.h" int Ns_ConnCopyToChannel(conn, ncopy, chan) int Ns_ConnCopyToDString(conn, ncopy, dsPtr) int Ns_ConnCopyToFd(conn, ncopy, fd) int Ns_ConnCopyToFile(conn, ncopy, fp) ARGUMENTS
Ns_Channel chan (in) Pointer to Tcl channel open for write. Ns_Conn conn (in) Pointer to open connection. Ns_DString dsPtr (in) Initialized dstring. int fd (in) File descriptor open for write. FILE fp (in) Stdio FILE pointer open for write. int ncopy (in) Number of bytes to copy. _________________________________________________________________ DESCRIPTION
These functions copy content from an open connection request to the given open file descriptor, FILE, dstring, or Tcl_Channel. The rou- tines work by copying from the content buffer; see the man page on Ns_ConnContent for how this buffer is managed for both small and large requests. The functions all return the number of bytes copied which will match the requested ncopy argument unless there is an error writing the con- tent or the requested bytes is greater than the number of bytes still available to be read. An internal offset into the connection is maintained and is shared with routines such as Ns_ConnRead which also consume content from the same buffer. Note that routines which access the entire content, e.g., Ns_ConnContent, Ns_ConnContentFd, or Ns_ConnGetQuery will continue to provide access to the entire request regardless if one of the Ns_ConnCopy or Ns_ConnRead functions have been used. EXAMPLES
The following example demonstrates copying user data to a temp file: fd = open("myfile.out", O_WRONLY|O_BINARY); len = Ns_ConnContentLength(conn); if (Ns_ConnCopyToFd(conn, len, fd) != len) { ... error writing content or content already consumed ... } SEE ALSO
Ns_ConnRead(3), Ns_ConnReadLine(3), Ns_ConnContent(3), Ns_ConnContentFd(3) KEYWORDS
connection, content, read AOLserver 4.0 Ns_ConnCopy(3aolserver)
All times are GMT -4. The time now is 11:48 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy