473,799 Members | 2,746 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

First CGI Script isn't right

TMS
119 New Member
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
2 1651
ghostdog74
511 Recognized Expert Contributor
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
119 New Member
ahhhhhhhhh....

'redface'

Thanks :)

tms
Apr 17 '07 #3

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

Similar topics

2
2021
by: DonLi | last post by:
Hello, I tested a PHP script with a FORM of 2 element and it delivered the mail but then when I added more FORM elements, it failed to deliver. Following is the content of the PHP script that I'm talking about, it is my first PHP script. Please advise what's wrong. The mail server, kind of unlikely, the first try it sent the mail (beginner's luck?), all of sudden, it went down? it's not on my box. Thanks.
10
2498
by: R.Marquez | last post by:
I hope I don't bore you with this personal experience. But, I hope the details are helpful for other Python and/or Linux newbies, or for those thinking about becoming such. I have been using Python on Windows for a few years now. One of the things that attracted me to Python was the fact that it offered the possibility of learning to program in Linux wile not even using Linux. I recognized a few years back that Linux would eventually...
11
2391
by: Fuzzyman | last post by:
What's the best, cross platform, way of finding out the directory a script is run from ? I've googled a bit, but can't get a clear answer. On sys.argv the docs say : argv is the script name (it is operating system dependent whether this is a full pathname or not). So this doesn't seem to be the answer.
2
1638
by: Sammy | last post by:
Hi Guys I have this form which checks for values before it process itself, all of the validation is working ok but to check for the strName if empty nothing works with it!! if i check for IsEmpty the blnValidName is always returns empty i tried it with if len(strname)>0 then blnvalidname=true else blnvalidname=false but still didnt work out! Thanx ---
18
9823
by: barry | last post by:
I'm having a problem creating a delay before each list item gets moved ( http://www.polisource.com/PublicMisc/list-splitter-timeout-bug.html ). Choose any number of columns, vertical layout, and view as a web page. They'll be a small delay before the entire bunch of list items converts from left-to-right to top-to-bottom order. I expected a delay before each item is moved. It looks like I have to flush the buffer to get setTimeout to work,...
7
1298
by: Dr J R Stockton | last post by:
I've heard that at <URL:http://www.merlyn.demon.co.uk/js-clndr.htm#P> and using Opera the suffixed dates in the yellow box appear in a single long line instead of in the obvious weekly manner. It's OK in IE 4 & 6. That sounds as if if (++k%7==0) document.writeln() is not working in Opera. Any explanation and/or suggestions? In particular, I'd like to know whether the circumstances will apply elsewhere on the site.
10
2679
by: Tom Cole | last post by:
While I've done javascript work for as long as I can remember (since Netscape first released it), I've only ever used it for trivial things, change a color here, validate a text element there, blah blah blah. With Ajax (actually, the uncovering of the XmlHTTPRequest object) I absolutely see the benefit of moving more of the UI work to the client, rather than doing page refreshes. I know there are a bunch of libraries out there...
3
1648
by: aventerprise | last post by:
<html> <head> <title></title> <script type="javascript" src="E:\Internet\positive_gearing.js"> function positve_gearing() { var price = form.price.value; var rates = form.rates.value;
2
1950
by: Marek Staniewski | last post by:
I need to make a window, which will be later placed on the internet page. In the window should be some map dispalyed. But this map is in fact a simple graphic file (e.g in *.jpg format) The cities, which appear on the map should not be attached to the map. They should come from a separate data base (e.g. MySQL). If someone place a mouse over a city then some links should be displayed between this city and some other selected cities. All...
0
9687
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10488
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10257
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10237
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7567
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5467
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5588
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3761
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2941
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.