Jump to content

help with read/write login


darkfreaks

Recommended Posts

hgey guys im trying to create a text based login but im having trouble to get the echo to show up on submit.php which is the form action page for signup.html.

 

am not sure how i would make it showup on either file.

 

<?php
$myFile = "password.txt";
$fh = fopen($myFile, 'w') or die("can't open file");
$data= strip_tags($_POST['Username']);
fwrite($fh,$data);
fclose($fh);

$File = "username.txt";
$fh2 = fopen($File, 'w') or die("can't open file");
$mydata = strip_tags($_POST['Password']);
fwrite($fh2,$data);
fclose($fh2);

echo "You have Signed up Successfully Congrats!";
?>

Link to comment
https://forums.phpfreaks.com/topic/214398-help-with-readwrite-login/
Share on other sites

The code you posted doesn't seem to relate to the question asked.

 

There are some problems with this code:

1) You're storing the username in the file named password.txt and the password in the file named username.txt

2) There's nothing in your code to say which password goes with which password

3) You REALLY should be using a database for this.

 

Ken

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.