First CGI Script isn't right

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • TMS
    New Member
    • Sep 2006
    • 119

    First CGI Script isn't right

    I'm using the book Programming Python and I just tried the first CGI script. This is the script:

    Code:
    print "Content-Type: text/html\n"
    print "<TITLE>CGI 101</TITLE>"
    print "<H1>A First CGI script</H1>"
    print "<P>Hello, CGI world!</P>
    And this is what it looks like when I open my browser (er... IE), and look at it:
    print "Content-Type: text/html\n" print "" print "
    A First CGI script

    " print "
    Hello, CGI world!

    "
    I really don't think its supposed to show print, "content-type... etc. "
    The book shows it just running the text. Any ideas?

    signed.... noobie

    TMS
  • ghostdog74
    Recognized Expert Contributor
    • Apr 2006
    • 511

    #2
    since you are doing a cgi script, you should put this script to your web server's cgi directory. let the web server execute the script for you. if you just see it using your web browser, it will just print out those text in plain on your browser. That's why you see those "print" words on your browser. check with your web server's documentation.

    Comment

    • TMS
      New Member
      • Sep 2006
      • 119

      #3
      ahhhhhhhhh....

      'redface'

      Thanks :)

      tms

      Comment

      Working...