notts.net - Nottinghamshire Community Site

notts.net Classifieds -

Classifieds.cgi - by Greg Mathews
Copyright ©1998 by notts.net
All Rights Reserved.

The author of this script cannot be held responsible for any errors or cause of loss due to this program. Use of this program is provided as is. No other warranties are expressed or implied.

There are three scripts to classifieds, "classifieds.cgi", "remove.cgi" and "removeall.cgi", the first is the actual script that posts the classified ads, the second allows a user to remove their ad if their item has been sold etc. and the third allows you to delete all ads placed on a certain date.

INSTRUCTIONS FOR SETTING UP THE CLASSIFIEDS.CGI SCRIPT

This script requires at least Perl v4 to run. Place it in your cgi-lib directory on your web server and "chmod 755" to turn it into an executable script.

Now, you'll need to edit three of the included form html files for your own ad form. Find the files "index.html", "remove.html" and "removeall.html" and make the following changes:

Now you'll need to create the individual files that the ads will be appended to. If you have five different topics such as "Business", "Employment", "Real Estate", "For Sale", and "Computers", you'll need a file for each different topic. It needs to be the exact name for the department you named in the form. We have included an example file 'computersoftware.html' with this script which you can copy and edit for each of the departments you use.

Take a look at the sample index file to see how the departments were added up.

Place the AdNumber.dta in the same directory as your classified ads. Make sure you chmod 777 this file and all the classified topic files that you created for each department. You'll also need to take the UserDataFile.html file and place it in the same directory and chmod 777 this file. The name and address info for each advertiser is placed in this file with a link added to the person's name to e-mail them if you need to. It also tells you what ad number it is, what department it was placed in, and the complete text of the ad.

Now you're all set. Make sure your ad form is pointed to "post" the information to the directory and file of the script. It should work. The only thing that you may need to change in the scripts files is the first line which points to your perl. The default is #!/usr/bin/perl

Download the Script