You should be very careful handling CGI files. If you type something wrong, it might be that the script will fail. We take good care of our scripts and all the script we place on the internet are tested. They work for us. If they don't work for you you'll see an error in the browser, sometimes with a detailed message. Read more about such problems by clicking here.
If you are not an experienced perl programmer, we advice you not to edit the code. (Except the things you need to change as described in "Getting the script to work". If you want to become a perl programmer, we advice you to look over as much scripts as you possibly can. This script included! Make sure you keep a copy of the script before you start changing things. Get to know certain routines etc., and visit sites like the MTVWebdesign Perl section, CGI-Resources.com (A lot of scripts and tutorials), Scriptsearch.com and Developer Daily. Also, we advice you too read messages in cgi-newsgroups.
Good luck!
I will try to give as much information as possible about the use of this script. Hope you understand it all. If not, you can always email me at cgi@mtvwebdesign.hypermart.net.
You'll find more information about some of the features in the rest of this page.
Go to http://mtvwebdesign.hypermart.net/scripts/ for the latest version
You need to have LWP installed on your server. Ask your webmaster.
The script is tested with success on the following system(s):
Pentium 133Mhz (32 Mb RAM), Apache 1.3.4 and Sambar Perl 5 (ActiveState) build 509 (January 4th 1999), Microsoft Internet Explorer 5.0.
use LWP::UserAgent; $ua = new LWP::UserAgent; $ua->agent("$ENV{'HTTP_USER_AGENT'}"); use CGI::Carp qw(fatalsToBrowser); # Provides you with fatal error message if they occur. use CGI qw/:standard/; require '/home/username/mailpage/mailpage.conf'; require $mtvwebdesignlib;These lines are probably the most important.
require '/home/username/mailpage/mailpage.conf';line should point to your config file. Please make sure you use an absolute path (as shown). Ask you webmaster for more information.
UPLOAD IN ASCII FORMAT!
<a href="/cgi-bin/mailpage/mailpage.cgi">Email this page!</a>You can also email other pages:
<a href="/cgi-bin/mailpage/mailpage.cgi?url=http://mtvwebdesign.hypermart.net">Email the MTVWebdesign page to a friend!</a>See the test.html file in the package.
BinaryDecimal
000 = 0
001 = 1
010 = 2
011 = 3
100 = 4
101 = 5
110 = 6
111 = 7
r = readable
w = writeble
x = executable
So to set the permission above, "rw-r--r-x", on the file "test.txt," you would figure out the decimal first:
rw- r-- r-x =
110 100 101 =
6 4 5
I get a 501 Internal server error. What should I do?
Well, you have a problem there....
What you should do first is checking if you uploaded the CGI file in ASCII format and not in BINARY format.
If that doesn't work, check if all the permissions (CHMOD) are set right.
If that doesn't work, check the server error log. Ask your webmaster for more information
What does "premature end of script headers mean"?
You probably uploaded the file in BINARY format. This should be ASCII format.
If that doesn't work, you should check the things you have changed in the script:
Is there a ";" at the end of lines? Are there any missing quotes (")? Etceteras.
How do I use a tokenfile?
First, take a look in the source of tokenfile.html. This is a page which has a tag in the source, which you cannot see when you view it in the browser. The tag is <!-- TOKEN --> (specified in setup.txt at $token). When you select that you want to use a template, Chat with me! will look for the $tokenfile (tokenfile.html) and that it 'll
search for the $token. If it finds the token (WHICH NEEDS TO BE PLACE ON A SEPARATE LINE IN THE SOURCE OF THE HTML DOCUMENT!), it'll print it's output at that spot in the html document. This way you get your own nice layout for the Chat with me! service!
TIP: Try to use STYLE tags in the $tokenfile!
We particularly point out our use of the English language. Since English is not our first language, we cannot make sure that there a no misspellings in the code.
If your made a change which you think makes the script run better, please email the change (script) to opensource@mtvwebdesign.hypermart.net