I’m working on an assignment so this does not have to be secure and I cannot work with a database, it has to be a text file.
I keep getting an error message on line 17, I know its probable simple but can’t find the error
Then once the user has created a a username and password and they need to sign in, how would I validate the username and password with the text file?
[php]<?php
if(isset($_POST[‘submit_btn’]))
{
$username = $_POST[‘name’];
$password = $_POST[‘pwd’];
$text = $username . “,” . $password . “\n”;
$fp = fopen(‘accounts.txt’, ‘a+’);
if(fwrite($fp, $text)) {
echo 'Your information has been saved';
}
fclose ($fp);
}
Please enter your information to create a Login account
Login Name:
Password:
?>[/php]