Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if(isset($_POST['create_user'])) {
- /*
- * Retrieve all the form values using the $_POST superglobal.
- */
- if($_POST['password']){
- die("passwords too short!");
- }
- if($_POST['password']){
- die("The password requires one uppercase letter a lower case letter and one number!");
- }
- if($_POST['password'] != $_POST['passwordagain']){
- die("passwords do not match");
- }
- $user_firstname = test_form_input($_POST['user_firstname']);
- $user_lastname = test_form_input($_POST['user_lastname']);
- $user_role = test_form_input($_POST['user_role']);
- $user_email = test_form_input($_POST['user_email']);
- $username = test_form_input($_POST['username']);
- $password = test_form_input($_POST['password']);
- $user_image = $_FILES['user_image']['name'];
- $user_image_temp = $_FILES['user_image']['tmp_name'];
- $user_image_filesize = $_FILES['user_image']['size'];
- if($user_image != "") {
- /*
- * This section of the code manages image uploads. As discussed in class,
- * we check if the file is of a specified type, and within the allowed file-size.
- */
- $target_file = "../images/" . $user_image;
- $finfo = finfo_open(FILEINFO_MIME_TYPE);
- $mime = finfo_file($finfo, $user_image_temp);
- /*
- * A list of MIME types are available here:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement