Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Organic Chemistry

Authors: L. G. Wade Jr.

8th edition

321768418, 978-0321768414

More Books

Students also viewed these Programming questions

Question

Show that if A is any m n matrix, then Im A = A and AIn = A.

Answered: 1 week ago