Would anyone know why this isn't working?
I have this php code
<?php // Script 11.6 - register.php
// This script displays and handles an HTML form.
// This script registers a user by storing their information in a text file and creating a directory for them.
// Address error handing.
ini_set ('display_errors', 1);
error_reporting (E_ALL & ~E_NOTICE);
if (isset ($_POST['submit'])) { // Handle form.
$problem = FALSE; // No problems so far.
if ($_POST['password1'] != $_POST['password2']) {
$problem = TRUE;
print '<p>Your password did not match your confirmed password!</p>';
}
if (!$problem) { // If there weren't any problems...
if ($fp = fopen ('../users/accounts.txt', 'ab')) { // Open the file.
// Create the data to be written.
$dir = time() . rand (0, 4596);
$data = $_POST['username'] . "\t" . crypt($_POST['password1']) . "\t" . $dir . "\n"; // \r\n on Windows
// Write the data and close the file.
fwrite ($fp, $data);
fclose ($fp);
// Create the directory.
mkdir ("../users/$dir");
// Print a message.
print '<p>You are now registered!</p>';
} else { // Couldn't write to the file.
print '<p>You could not be registered due to a system error.</p>';
}
} else { // Forgot a field.
print '<p>Please try again!</p>';
}
} else { // Display the form.
// Leave PHP and display the form.
within this template - http://stu.aii.edu/~jas5317/php/register2.php
It's not doing the verifications for the password or printing the confirmation.
I'm stumped