Results 1 to 2 of 2

Thread: CGI Input / Output

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2001
    Location
    UK
    Posts
    8

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

  2. #2
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923
    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
  •  



Click Here to Expand Forum to Full Width