Beefy Boxes and Bandwidth Generously Provided by pair Networks Frank
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Writing a web message board from scratch

by lolly (Novice)
on Apr 19, 2002 at 16:08 UTC ( #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 :)


Comment on Re: Writing a web message board from scratch
Select or Download Code
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
Node Status?
node history
Node Type: note [id://160593]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2014-04-21 04:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (490 votes), past polls