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
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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.