self updates of HTML pages

I must allow people to update their own page with a few lines. I thing the easiest is to pasword protect a cgi which rebuilds the entire page with the entries. But I have not get time yet to really learn Perl.
Could someone help me in telling me what to do :
-  about the password
-  about the general structure (I fear wasting a few hours finding back the basics about file entry/reading as I have no perl book  in here).
toulonAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

TYoungCommented:
PERL:
Reading a file is very simple. First you need a file handle, usually a word that describes the file. Lets just say PAGE.

SO... we open the file, and give it the name PAGE.

open(PAGE, "/home/httpd/docs/users/myuser/index.html");

Simple. Then use an array variable to get the pages contents... like this:

@pagecontents = <PAGE>;

Again, Simple. Then close the file.

close(PAGE);

Now the @pagecontents contains the contents of the page you opened.

To write to the file, you have pretty much the same command, with one extra character:


open(PAGE, ">/home/httpd/docs/users/myuser/index.html");

The > says to open the page for output. So then to print to the page, use commands like this:

print PAGE "This is line 1\n";

or for using a lot of lines, do something like this:

print PAGE <<__STOP__;
<html>
<head>
<title>This is the title</title>
</head>
<body>
<font color="#62DA87">Hello</a>
</body>
</html>
__STOP__

That is useful so you don't have to put in \n's and backslashed before the quotes, etc.


------------------------ PASSWORDS ------------------------
Have a : delimited file with usernames and encrypted passwords. To encrypt the passwords, use the crypt function, and remember the SALT. Like this:

$password = crypt("AB", $FORM{'password'});

In that case, AB is the salt.
The file should look something like this:

admin:37gfdj657JHGG
tony:hdvSNF7dna7dadf/
brad:a752nq740vqn34

Then read in the file, split the lines from the : and compare the login usernams and passwords to the ones in the file.

Note: To compare the passwords, encrypt the one they entered for the login, and see if it matched the one in the file.

Hope this helps.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
toulonAuthor Commented:
Excellent.
Just something: how do I read online?
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Scripting Languages

From novice to tech pro — start learning today.