JezK
Edit File: registrationform-action1.php
<?php session_start(); include "./app/admin_functions.php"; $connect = new admin(); $connect->dbconnection(); function test_input($data) { $data = stripslashes($data); $data = htmlspecialchars($data); return $data; } if (isset($_POST['submit']) == "submit") { $name = test_input($_POST['name']); $mobile = test_input($_POST['mobile']); $email = test_input($_POST['email']); $college = test_input($_POST['college']); $address = test_input($_POST['address']); $emergName = test_input($_POST['emergName']); $emergRelation = test_input($_POST['emergRelation']); $emergNumber = test_input($_POST['emergNumber']); $duration = $_POST['duration']; $date = date('Y-m-d'); $interest = $_POST['interest']; $file = $_FILES["image"]; $idproof = $_FILES["IDproof"]; // File details $file_name = time().$file["name"]; $idproof_name = time()."_ID_".$idproof["name"]; $file_type = $file["type"]; $idproof_type = $idproof["type"]; if ( ($file_type == 'image/png' || $file_type == 'image/jpg' || $file_type == 'image/jpeg') && ($idproof_type == 'image/png' || $idproof_type == 'image/jpg' || $idproof_type == 'image/jpeg') ) { $file_temp = $file["tmp_name"]; $idproof_temp = $idproof["tmp_name"]; $file_error = $file["error"]; $file_size = $file["size"]; $destination = "uploads/"; $target_path = $destination . $file_name; $idproof_path = $destination .'id_proofs/'. $idproof_name; if (move_uploaded_file($file_temp, $target_path)&& move_uploaded_file($idproof_temp, $idproof_path)) { $result = $connect->insertUser($name, $email, $mobile, $college, $address, $interest, $date, $duration, $file_name,$idproof_name, $emergName, $emergRelation, $emergNumber); if($result > 0){ $_SESSION['registrationSuccess'] = 1; $_SESSION['registrationID'] = $result; $_SESSION['email'] = $email; $_SESSION['name'] = $name; $_SESSION['mobile'] = $mobile; $_SESSION['college'] = $college; header('Location: review.php'); }else { $_SESSION['notok'] = 'fail'; header('Location: registration1.php'); } } else { $_SESSION['notok'] = 'fail'; header('Location: registration1.php'); } } else { $_SESSION['notok'] = 'fail'; header('Location: registration1.php'); } } else { $_SESSION['notok'] = 'fail'; header('Location: registration1.php'); }