Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Writing a web message board from scratch

by lolly (Novice)
on Apr 19, 2002 at 16:08 UTC ( [id://160593]=note: print w/replies, xml ) Need Help??


in reply to Writing a web message board from scratch

you want to build a perl cgi from scratch?? i dont know much about object orientated perl if thats what your after... anyway, personally i would get it looking however you want it first, then when you test your perl script you can see how it works. for the perl
use CGI; $query = new CGI; # start the html output print STDOUT $query -> header(); print STDOUT $query -> start_html ( -title=> "Message board.cgi", -BGC +OLOR=>"yellow"); print STDOUT "\n<h1><align=center>PUT YOUR TITLE HERE</CENTRE></H1>\n" +; # retrive info from the html form using he param function # e.g $people = $query ->param ('people'); # do this for all your variables # design some failsafes using perls regular expressions so that # if nothing has been entered in the message box they get a warning # message if ($message !~/\w+/) { print STDOUT "<P> you have not entered a message\!\n"; print STDOUT $query -> end_html; exit (0); }
on your html form you need to a comand that accesses the perl script. it should look something like this
<form method ="post" action ="http://www.whereever/directory/myCGI.cgi" enctype="multipart/form-data">
Hope this was what you were after. Lolly :)

Replies are listed 'Best First'.
Re: Re: Writing a web message board from scratch
by Dogma (Pilgrim) on Apr 20, 2002 at 03:15 UTC
    $people = $query ->param ('people');

    I would THINK about doing some taint checking here. Having validated data is the first step to writing a secure site....

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://160593]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (6)
As of 2024-04-18 15:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found