Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

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 :)

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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://160593]
[bounim]: yo

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (1)
As of 2018-01-21 22:44 GMT
Find Nodes?
    Voting Booth?
    How did you see in the new year?

    Results (230 votes). Check out past polls.