|
-
Jun 2nd, 2001, 02:59 PM
#1
Thread Starter
New Member
CGI Input / Output
Hi,
Can u PLEASE HELP ME
If possible i would like a simple example of input and output in CGI ASAP
(txt file)
PLEASE HELP
Last edited by KieranSmith; Jun 2nd, 2001 at 03:08 PM.
-
Jun 8th, 2001, 09:00 PM
#2
PowerPoster
Upload this perl script called input.cgi to your cgi-bin.
Code:
#!/usr/bin/perl
# The following assumes you have CGI.pm installed, comes with Perl
use CGI qw(:standard);
$strInput = param('Text1');
# Specify HTML/Text document
print "Content-type: text/html\n\n";
# Print HTML Header
print '<html>
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">
<title>My Interesting Page</title></head><h1>';
# Output value obtained from browser
print "You typed \"$strInput\"";
print '</h1></html>';
Type this URL into a browser...
Code:
http://www.mydomain.com/cgi-bin/input.cgi?Text1=Hello%20World!
If you want to use a simple HTML for to provide the input instead of the URL, just create a standaard form with a text box on it called Text1. The submit button would then POST the info to the script.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|