By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,750 Members | 1,456 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,750 IT Pros & Developers. It's quick & easy.

First CGI Script isn't right

TMS
100+
P: 119
I'm using the book Programming Python and I just tried the first CGI script. This is the script:

Expand|Select|Wrap|Line Numbers
  1. print "Content-Type: text/html\n"
  2. print "<TITLE>CGI 101</TITLE>"
  3. print "<H1>A First CGI script</H1>"
  4. print "<P>Hello, CGI world!</P>
  5.  
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
Apr 16 '07 #1
Share this Question
Share on Google+
2 Replies


Expert 100+
P: 511
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.
Apr 17 '07 #2

TMS
100+
P: 119
TMS
ahhhhhhhhh....

'redface'

Thanks :)

tms
Apr 17 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.