[CLUG] [OT] CGI Help

Peter Flynn peter at silmaril.ie
Sun Feb 27 19:28:03 GMT 2000


On Sat, 26 Feb 2000, Damien wrote:
>  Example: some mechanic adds his cv in the "Automotive section " 
> and the page then says " There are 9 people who have submitted 
> their c.v.s in the Automotive Section"  

The problem with all these kinds of application is that the frivolous
submissions get auto-counted along with the genuine ones. 

>  I can use some mailform cgi for the CV submission but what do I 
> add into the script to increment some stored variable and then 

Have one file per class of employment, eg /var/local/cvs/teachers.dat
etc.

In the script:
Check no other process (of the script) is using the file (check and write a lock file)
Read the previous value from a file, add 1 to it and write it back to the file.
Process the form.
Remove the lock.

Assuming you are using a Web server like Apache that can do server-side
inclusion: use multiple files, one for each employment class; rename the
HTML files to .shtml and add in the relevant place:

[eg teachers.shtml]
There have been <!--#exec cmd="cat /var/local/cvs/teachers.dat"-->
teachers' CVs submitted.

There are lots more elegant ways, though...
///Peter




More information about the Cork mailing list