Question
Need some assistance with PHP form handling, and uploading the contents of a form to a txt file. This my program, that needs to be
Need some assistance with PHP form handling, and uploading the contents of a form to a txt file.
This my program, that needs to be modified:
$redirect = false;
$username = trim($_POST['username']);
$password = trim($_POST['password']);
$verify = trim($_POST['verify_password']);
$email = trim($_POST['email']);
if(!preg_match('/^[a-z]([a-z]|[0-9]){6}([a-z]|[0-9])*[0-9]+$/i', $username))
{
$redirect = true;
}
elseif(!preg_match('/((?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[,.\/?*!])){8}/', $password))
{
$redirect = true;
}
elseif($password != $verify)
{
$redirect = true;
}
elseif(!preg_match('/^[a-z][a-z0-9.+]{3,}([a-z]|[0-9])+@{1}(yahoo\.com|yahoo\.ca)$/i', $email))
{ //(?=.{15,})
$redirect = true;
}
if($redirect)
{
header('Location: index.html');
exit();
}
?>
COMP 3015
COMP 3015
Thanks!
-----------------------------------------------------------------------------------------------------------
Once the form is successfully filled out, I need to record each user into a txt file named 'signups.txt' Separate each form field with an '@' Hash the password using md5() The format should be: username@passwordhash@email
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started