signup.php
<?php
session_start();
if($_POST['name']=="" OR $_POST['name']=="" OR $_POST['number']=="" OR $_POST['nrc']=="" OR $_POST['email']=="" OR $_FILES['upload']['size'] == 0 OR $_POST['password']=="") {
$password= md5('$password');
$json = json_encode(array(
'status' => 'notsuccessfull',
'responseResult' => 'datanotposted'
));
echo $json;
exit;
} else {
$upload_file = $_FILES['upload'];
$upload_file_name = $upload_file['name'];
$upload_file_temp = $upload_file['tmp_name'];
$upload_file_size = $upload_file['size'];
$upload_file_error= $upload_file['error'];
$upload_file_destination = '../images/'.$upload_file_name;
if(move_uploaded_file($upload_file_temp ,$upload_file_destination))
{
$first=filter_input(INPUT_POST, "name");
$last=filter_input(INPUT_POST, "name");
$phone=filter_input(INPUT_POST, "number");
$identy=filter_input(INPUT_POST, "nrc");
$em=filter_input(INPUT_POST, "email");
$psw=filter_input(INPUT_POST, "password");
$finaluploaddestinate = '../image/'.$upload_file_name;
require_once '../conf/loan.php';
$conn = new PDO("mysql:host=localhost;dbname=auction", 'root', "");
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$insertquery = "INSERT INTO signup(first,last,phone,identy,email,pic,pass) VALUES (:f,:l,:p,:i,:e,:pic,:pa)";
$insertcustomerinformation = $conn->prepare($insertquery);
$insertcustomerinformation->bindParam(':f',$first);
$insertcustomerinformation->bindParam(':l',$last);
$insertcustomerinformation->bindParam(':p',$phone);
$insertcustomerinformation->bindParam(':i',$identy);
$insertcustomerinformation->bindParam(':e',$em);
$insertcustomerinformation->bindParam(':pic',$finaluploaddestinate);
$insertcustomerinformation->bindParam(':pa',$psw);
$insertcustomerinformation->execute();
$customerid=$conn->lastInsertId();
if($customerid > 0){
$json = json_encode(array(
'status' => 'successfull',
'responseResult' => 'uploadsuccessful'
));
echo $json;
exit;
} else {
unlink($upload_file_destination);
$json = json_encode(array(
'status' => 'notsuccessfull',
'responseResult' => 'uploadnotsuccessful'
));
echo $json;
exit;
}
} else {
}
}
?>
What I have tried:
have tried different methods but have failed and have never done it before,anyone with help.