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
split(n)						       Tcl Built-In Commands							  split(n)

__________________________________________________________________________________________________________________________________________________

NAME
split - Split a string into a proper Tcl list SYNOPSIS
split string ?splitChars? _________________________________________________________________ DESCRIPTION
Returns a list created by splitting string at each character that is in the splitChars argument. Each element of the result list will con- sist of the characters from string that lie between instances of the characters in splitChars. Empty list elements will be generated if string contains adjacent characters in splitChars, or if the first or last character of string is in splitChars. If splitChars is an empty string then each character of string becomes a separate element of the result list. SplitChars defaults to the standard white-space char- acters. EXAMPLES
Divide up a USENET group name into its hierarchical components: split "comp.lang.tcl.announce" . -> comp lang tcl announce See how the split command splits on every character in splitChars, which can result in information loss if you are not careful: split "alpha beta gamma" "temp" -> al {ha b} {} {a ga} {} a Extract the list words from a string that is not a well-formed list: split "Example with {unbalanced brace character" -> Example with {unbalanced brace character Split a string into its constituent characters split "Hello world" {} -> H e l l o { } w o r l d PARSING RECORD-ORIENTED FILES Parse a Unix /etc/passwd file, which consists of one entry per line, with each line consisting of a colon-separated list of fields: ## Read the file set fid [open /etc/passwd] set content [read $fid] close $fid ## Split into records on newlines set records [split $content " "] ## Iterate over the records foreach rec $records { ## Split into fields on colons set fields [split $rec ":"] ## Assign fields to variables and print some out... lassign $fields userName password uid grp longName homeDir shell puts "$longName uses [file tail $shell] for a login shell" } SEE ALSO
join(n), list(n), string(n) KEYWORDS
list, split, string Tcl split(n)
All times are GMT -4. The time now is 07:58 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy