Join + login pages with out mysql.

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Darkside
Forum Commoner
Posts: 43
Joined: Wed Oct 30, 2002 4:18 pm

Join + login pages with out mysql.

Post by Darkside »

How hard would it be to make a join and a log in page with out using sql & mysql?

Any tutorials would help.
bionicdonkey
Forum Contributor
Posts: 132
Joined: Fri Jan 31, 2003 2:28 am
Location: Sydney, Australia
Contact:

Post by bionicdonkey »

not very...u would just have to use something else to store the values. e.g text file.
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

You could also just have the password and login hardcoded into variables in the php-page itself.

Code: Select all

<?php
$login="myLogin";
$password="myPassword";
?>
lc
Forum Contributor
Posts: 188
Joined: Tue Apr 23, 2002 6:45 pm
Location: Netherlands

Post by lc »

That's the way I do it.

I store a name/pasword and randomly generated code (generated when the account is made) in a "textfile" or actually it's a .php file with just <?php on the first line and ?> on the last so that no one can access it without ftp access.

Then after people login I set a variable in the links like:
<a href=\"$PHP_SELF?id=$the_random_code\">link</a>

And every time a page loads I check if the code exists and if so they are logged in.

I also store the time/date of the latest login of that user... if it's too long ago... they have to login again.

Currently the code I use consists of 3 letters and a number between 100 and 1.. which means almost 2 million combos are possible... secure enough for me since no one really knows where the code is hidden in the string I use for the $id variable which usually holds more data as well.
Plex
Forum Newbie
Posts: 3
Joined: Mon Feb 17, 2003 11:10 pm

Could you...

Post by Plex »

Could you send me a copy of that script and a small tutorial on how to use it and set it up on my site? I really would like to use something like that. I help run a few websites that both get close to 20k hits a day and we need something of this sort, it would help us out tremendously. Please let me know, thanks.
User avatar
Sky
Forum Commoner
Posts: 71
Joined: Wed Oct 02, 2002 4:00 pm

Post by Sky »

It's really easy, actually. just go to the new sessions topic and learn about session managment. once you do that,the only problem left to you will be storage... and tha'ts easy.I found a cool ini file array format storage function collection... like it?

It's what I'm using, and it's pretty self explanitory.
Post Reply