Below is the code which you have to paste in the PHP part / programming part
<?php
include ('database.php');
$value1 = 'Pending';
$id = $_GET['id'];
if (isset($_POST['submit'])) {
$allow = array("jpg", "JPG", "jpeg", "JPEG", "gif", "GIF", "png", "PNG", "pdf", "PDF");
//1st File
if($_FILES['photo1']['name'] == "") {
//echo "No Image"
} else {
$photo1=basename($_FILES['photo1']['name']);
$extension = pathinfo($photo1, PATHINFO_EXTENSION);
if(in_array($extension,$allow)){
$target_path = "uploads/";
$photo1 = md5(rand() * time()).'.'.$extension;
$target_path = $target_path . $photo1;
move_uploaded_file($_FILES['photo1']['tmp_name'], $target_path);
$photo_one = ($photo1!='')?" reg_st_photo='$photo1' ". ',':'';
}
}
try {
$sql = "UPDATE register_form SET
$photo_one
reg_st_status = :value1
WHERE id = :value2
";
$stmt = $pdo->prepare($sql);
$stmt->bindParam(':value1', $value1);
$stmt->bindParam(':value2', $id);
$stmt->execute();
echo "Record inserted successfully.";
header("Location: class.php");
} catch (PDOException $e) {
echo "Error: " . $e->getMessage();
}
}
?>
Below is the code which you have to paste in the HTML part / designing part
<form method="POST" action="" enctype="multipart/form-data">
<div class="card-body">
<div class="row">
<div class="col-6">
<div class="form-group">
<label for="exampleInputEmail1">Upload Passport Photo</label>
<input type="file" class="form-control" name="photo1">
</div>
</div>
</div>
</div>
<div class="card-footer">
<button type="submit" class="btn btn-primary" name="submit">Proceed To Next Step</button>
</div>
</form>