SFELinkAdd 1.0 Copyright 2001-2004, Kristina Pfaff-Harris (http://www.tesol.net/scriptmail.html) =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Contents of this file: Program Summary Known Problems with SFELinkAdd Copyright & Licensing Information Legal Notice & Disclaimer Getting Started with SFELinkAdd 1.0 Setting up Files, Directories, and Permissions What to Do About Problems Other Scripts =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Program Summary: SFELinkAdd v1.0 is a simple program which can be used as a links directory or a sort of guestbook. It's nearly identical to MakeBook v3.0 plus with the addition of adding links. It allows a user to enter their name, email address, a link title, a link URL and some text (a description of the link submitted) which will then be added to the "linkfile". It does a tiny bit of error checking to make sure the person entered something, and does a cursory check of the email address to make sure it resembles a real address (i.e. checks for "@" and at least one ".") and the link url to be sure it resembles a link (making sure it starts with http://, etc). You can configure it to determine whether new entries should be placed at the beginning or the end of the "linkfile," and choose whether or not to display the date of submission, and the name and email address of each contributor. You may also choose to have it email you each response, as well as whether to hold all new posts for you to approve, or just add it to the file. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Known problems with SFELinkAdd The main issue with SFELinkAdd is that if your web server does not appropriately send the "HTTP_REFERER" variable, then the "$use_form_as_linkfile" will not work. The multiple linkfile thing has NOT been tested in SFELinkAdd, so you have been warned. Please report bugs! =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Licensing & Copyright Information: The Licensing terms and conditions are listed within the sfelinkadd.cgi program itself. This program is Copyright 2001-2005, Kristina L. Pfaff-Harris. All rights reserved. You may use this program free of charge provided you agree to and abide by the License agreement contained within the program. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Legal Notice & Disclaimer: This program is offered as-is and no warranty is given, either express or implied. By downloading, modifying, copying, viewing, or using this program, you agree that neither the author of this program nor the owners or administrators of the site from which you downloaded this program are liable for any breach of security, damage or loss caused directly or indirectly by the use of this program, and that any such breaches, damage or loss is the sole responsibility of the person who downloads, modifies, copies, views, or uses this program. The author has attempted to make this program as bug-free and secure as possible, but there is always the possibility of something being overlooked, hence the author disclaims any responsibility for problems incurred in the use of this program. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Getting Started with SFELinkAdd: This assumes that you have permission to execute cgi programs on your server, and that you know where the programs have to go. Sometimes, a web server is set up so that all cgi programs must be in a single directory (usually /cgi-bin). If you don't know whether or not you have permission to do this, or if you don't know where the programs must go, ask the technical support people for your website. First, open the sfelinkadd.cgi program in a plain text editor such as "pico," "vi," or "notepad." You will see many places which need to be changed to fit your server. Please read all the instructions carefully, and be attentive to what you're changing. When you are done, save the file as plain text, and upload it to the place where you put your CGI programs on your web server. If you are on a Unix/Linux server, chmod this file 755. Next, open the sfelinkadd.html program in a plain text editor. Here, you will see a line that begins:
You *must* change that "http://etc." to the web address of where you've put the sfelinkadd.cgi program on your web server. It may not be "cgi-bin" or it may be something different: it depends on where you uploaded it. Please check with your web hosting provider for questions about where you need to put your HTML pages or CGI scripts. When you are done, save that file as plain text, and upload it to the place where you put your web pages. If you are on a Unix/Linux server, chmod this file 644. IMPORTANT!!!! The SFELinkAdd script will generate its own submission form! The benefit of this is that it will detect whether or not name, email, etc will be public and let the user know. In addition, it will dynamically tell people the maximum length of the link description, and limit them to that length. You can use a generic HTML form, of course, but it will not have this flexibility. Plus, if there is an error, the program will show this default form anyway, so you might just ignore the whole sfelinkadd.html thing altogether. :-) Now, upload the "linkfile.html" page. This should pretty much be a blank page when you start out. However, if you look at it in a plain text editor, you will see these lines: These lines are invisible to the web browsers, but they tell the SFELinkAdd program where to put the links that users add. Whatever you do, do NOT remove or alter these two lines in any way. If you are on a Unix/Linux web server, chmod this file 766 so that the server can write to it. Now you should be ready to test out your link page! Pull up the sfelinkadd.cgi script in your browser, fill out the form, and hit the button. If you can then pull up the "linkfile.html" page in your browser, and see what you entered, it's working! If not, then edit sfelinkadd.cgi, set $debugging = 1; upload it again, and see if the debugging information tells you anything helpful. Towards the bottom of the debugging messages, SFELinkAdd should tell you if it can't find your linkfile, can't write to it, and so forth. If all the debugging info is complete nonsense to you, feel free to send it to me: http://www.tesol.net/scriptmail.html with a description of the problem you're having and I'll try to help. You'll also want to be able to log into the Admin pages to approve entries, or to edit/delete existing entries. To pull up the Admin screen, use: http://www.yourdomain.com/cgi-bin/sfelinkadd.cgi?FA=Admin where "http://www.yourdomain.com/cgi-bin/sfelinkadd.cgi" is the actual address of where you have set up SFELinkAdd on your server. It will ask for a username and password. Put in what you put for $admin_login and $admin_password when you set up the script. You should then be able to approve entries. That's pretty much all there is to it -- you should now be ready to go. Enjoy! =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Setting up Files, Directories, and Permissions On some web servers, you must put all your CGI programs in a special directory (or folder) of their own, usually "cgi-bin" or "_cgi" or somesuch. On other web servers, you can put them anywhere you like as long as they end in .cgi or .pl. You must get this information from your web hosting provider: it's different on each web server. In the case of SFELinkAdd, the sfelinkadd.html form must have permissions of 644, the linkfile must have permissions of 766, and the sfelinkadd.cgi program must have permissions of 755. If you're not sure what all this "permissions" stuff means, please check the FAQ: http://tesol.net/scripts/FAQ/. Another brief note: If you wish, you may use the "comments.html" file (available with MakeBook v3.x - tesol.net/scripts/MakeBook/) as a template to show you how to use multiple guestbooks or comments pages. The "comments.html" page is a sort of combination of the sfelinkadd.html file and the linkfile.html file, where it has the form for sending in the entry, but also has the and lines. Note that if you use this setup, each "comments.html" file must also be chmod 766, or, in other words, any file that you want SFELinkAdd to add stuff to has to be chmod 766. Please note that in the script, when I say something like "/home/users/yourname" or "c:/inetpub/wwwroot/something", I am speaking of your "home directory" as it is known to the tech folks. If you ask your tech support people "What is the full system path to my home directory?" then they should be able to tell you. Sometimes this might be something like "/var/opt/web/data/yourlogin" or something totally different. You've got to get this information from the people who run the server where your website is. You might find the entry "What should I ask my web hosting provider before setting up a CGI script" in the FAQ helpful. The FAQ can be found at http://tesol.net/scripts/FAQ/ =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= What to Do About Problems: First, please check the FAQ at http://www.tesol.net/scripts/FAQ/ and make sure your question or issue has not already been answered. A few notes: If get an error such as "Internal Server Error," "Premature end of script headers", "Permission denied," "Forbidden" or "File not found," here are a few things to check: 1. Did you ftp the file in ascii mode? You must ftp cgi programs in Perl in ascii mode or they won't work. 2. Did you change the permissions of the cgi program to be 755 (On some programs you need to click "read" and "execute" for the file to do the same thing.)? 3. Is the path to perl with the #! on the very, very first line of the file? Sometimes this is tricky to tell, but there cannot be even a single blank line before #!/usr/bin/perl and the top of the file or it won't work. 4. In the cgi program, did you leave out a " or a ;, or did you use "" when it says to use ''? In the places where it tells you that you must put a backslash (\) in front of certain characters, did you use a forward slash instead (/) or did you miss one or two things? IMPORTANT: If you contact me with a problem about this program, you MUST give me as much information as possible. Please include the following information: The name of this program. (I have several programs on this website, so if you email me saying "The program doesn't work" or "Please help me" I won't know what you're talking about.) The version of this program. (This is SFELinkAdd 1.0.2) The information that the server shows when you set $debugging = 1; in the program. Yes, all of it, please. :) The error message you got, and what you did to get that error. The location of your website where you have set up this program (http://www.yourdomain.com/etc.) so that I can take a look at it. In addition, If you know who your web hosting provider is, this information would be helpful as well. Many times, the web hosting provider will have important information about how to set up CGI programs on their server. If they do, then I can look up that information to be able to help you. When you have all this information together, or as much information as you can get, please contact me: http://tesol.net/scriptmail.html . Remember: the more information you can give me, the better I will be able to help you. :) =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Other Scripts: If you like this program, try some of the other CGI scripts available at Kristina's Scripts for Educators: http://www.tesol.net/scripts/ Currently available are: AddrBook: A simple web-based address book AffordaBilly: Loan affordability calculator: how big a loan can you afford? AutoCGIMail: Create your own custom email forms and scripts online! CGI-Subscribe: An email mailing list manager Chat-N-Time: Real-time web-based chat CrosswordMaker: A tool to create and grade HTML crossword puzzles GradeORama: Online gradebook server MakeBook: A guestbook/ongoing story program. PayBackTime: Calculator for how long it will take to pay off a debt or loan. QAMaker: Online FAQ/Question & Answer list generator Quadratic-O-Matic: A simple quadratic equation solver QuizTest: Offer multiple-choice/true-false quizzes Quotesie: Yet another random-quote generator. RandomQuiz: Generates quizzes with randomly selected questions RemindMe: An email auto-reminder service SFEBanner: Simple banner, quote, image rotator. SFEBlackJack: Simple online video BlackJack game SFEHangman: Simple online multi-language Hangman game SFEPoker: Simple online video Poker game SFESurvey: Another survey/quiz generator. SFEWordSearch: Generate printable wordsearch puzzles SillySearch: Let people search for pages on your website SillyCount: Let's you create a web-page counter. SillySite: A simple web-page creation program VeryInteresting: Loan Interest calculator and amortization table generator VocabSearch: Create and search a list of vocabulary words Votesie: Online voting booth/Poll generator Web-B-Mail: Private, web-only email-like system with pictures. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Thanks for using SFELinkAdd! =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=