Help: I want a chat script!

Flavian Hardcastle deathtospam43423 at altavista.com
Sat Feb 9 20:26:29 EST 2002


Philip Swartzleonard <starx at pacbell.net> wrote in
news:Xns91AFAD9B27944RASXnewsDFE1 at 130.133.1.4: 

> Well, as far as i can remeber, CGI is just an interface, you can use it
> with Perl or Python or C or whatever. You probably will have to learn
> it, but it should just be a modlue and some extra commands IN python...
> and you'll have to configure whatever web server you're using to use
> CGI program, that's probaly the hard part.
> 
Done. I downloaded a personal web server with CGI capabilities.

[snip]

> Anyway, you'd only need unix sometimes if you used that kind of server,
> and you don't even want a server... if you can get your computer to run
> CGI's, and check out 11.2 (or so) of the library reference manual for
> the CGI commands, you should be most of the way there.
> 
> Sorry for the longness :)
> 
Thanx for the info. 
I have been looking through 11.2. It seems to mainly deal with how to 
process the information once you've already got it from the web browser. 
For instance this example from the manual ...

form = cgi.FieldStorage()
if not (form.has_key("name") and form.has_key("addr")):
    print "<H1>Error</H1>"
    print "Please fill in the name and addr fields."
    return
print "<p>name:", form["name"].value
print "<p>addr:", form["addr"].value

... the first line appears (correct me if I'm wrong) to take what ever data 
has been inputed to the cgi and store it in a variable called "form".

But I haven't managed to do that yet. :( Everytime I go to my servers cgi-
bin with my browser, and enter information on a form, I can't find the 
information anywhere.

Basically all I want to be able to do at this stage is take information 
from a form on a web browser, and place it in a file. What's the easiest 
way to do this? 

There are html tutorials on how to process forms ... but like I say, they 
all seem to want you to learn PERL and get a UNIX server. 
-- 
"You can tell whether a man is clever by his answers. You can tell whether 
a man is wise by his questions."  Naguib Mahfouz

netvegetable at dingoblue.net.au



More information about the Python-list mailing list