Find the answer to your Linux question:
Page 2 of 2 FirstFirst 1 2
Results 11 to 13 of 13
The problem with your script is the very first print statement: Code: print "content-type: text/html\n\n\"; <-- Remove the \ before the final quote Now then, I've uploaded the fixed script ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #11
    Linux Guru Cabhan's Avatar
    Join Date
    Jan 2005
    Location
    Seattle, WA, USA
    Posts
    3,252

    The problem with your script is the very first print statement:
    Code:
    print "content-type: text/html\n\n\";  <-- Remove the \ before the final quote
    Now then, I've uploaded the fixed script to my own webserver, and it doesn't have an IP address.

    The CGI that I know makes use of the CGI module, which contains a function called remote_host() which, as you might imagine, prints out the remote host.

    Unfortunately, I don't know what's wrong with the way you've done it; my assumption is that the environment variable may not be called $REMOTE_HOST. Try and see if there's another way to do it.

  2. #12
    Linux Newbie
    Join Date
    Oct 2005
    Posts
    110
    ok i type 127.0.0.1/cgi-bin/12.cgi and this is what i got
    Server error!

    The server encountered an internal error and was unable to complete your request.

    Error message:
    Premature end of script headers: 12.cgi

    If you think this is a server error, please contact the webmaster

    Error 500

    127.0.0.1
    Sun 01 Jan 2006 01:03:33 PM CST
    Apache/2.0.40 (Red Hat Linux)
    this is same code i did but name it 12.cgi

  3. #13
    Linux Newbie
    Join Date
    Oct 2005
    Posts
    110

    cgi-bin

    can give me a perlscript to make a simple form submit and the how to view the results

Page 2 of 2 FirstFirst 1 2

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •