PDA

View Full Version : Registration



<?PHP>
10-02-2008, 03:02 PM
How would i go about making a registration form for a login script. It runs flat file and works by getting the usernames and passwords from /log.txt

How could i make a form that would add usernames and passwords to that.

+Rep for any help

Zedtu
10-02-2008, 03:04 PM
Thats extremely insecure, I would suggest switching to a MySQL based solution.

All someone would have to do is visit that text file for all of the users' usernames and passwords.

<?PHP>
10-02-2008, 03:06 PM
Yes i know. I'm just using it as a basic example.

Could anyone help me?

Decode
10-02-2008, 03:06 PM
How would i go about making a registration form for a login script. It runs flat file and works by getting the usernames and passwords from /log.txt

How could i make a form that would add usernames and passwords to that.

+Rep for any help
People could find the text file if it is called log.txt rename it to something like 23jdhs7j2.txt or put it in a sub folder with a htaccess file.

<?PHP>
10-02-2008, 03:07 PM
Yep, It has htaccess... And i will do when the sites done. Atm it dont really matter. Nothing to protect

timROGERS
10-02-2008, 09:01 PM
Name makes no difference if you configure an htaccess file, just make it so it can only be read by the server.

<?PHP>
11-02-2008, 09:44 AM
Done ^^

Anyone Help Me?

chrisgocrazyH
11-02-2008, 10:15 AM
search the forms for a submit form because i remeber someone requesting when you submit
somthing it saves to something.txt ;p

MrCraig
11-02-2008, 01:31 PM
@above - WIT?!

Um, it depends how your logs.txt file is layed out.. As it will have to be exploded..

if its


User1||password
User2||password


Then you'd do something like



<?php
$s = @file_get_contents("logs.txt");
$uinf = nl2br($s);
$uinf = explode("<br />",$unif);
foreach($uinf as $user)
{
$userinf = explode("||",$user);
$username = trim($userinf[0]);
$password = trim($userinf[1]);
}
?>


Then build a login system around that (which i really cba doing atm)
But that bit of code will break up the usernames and passwords.

MrCraig
11-02-2008, 02:45 PM
Oh right sorry, thought u wanted login part...

just use fwrite ?

Want to hide these adverts? Register an account for free!