session_start();
$_SESSION['id'] = '$id';
$_SESSION['name'] = '$name';
$_SESSION['phone'] = '$phone';
$_SESSION['email'] = '$email';
$_SESSION['image'] = '$image';
$_SESSION['error'] = '$error';
<form id="formm" action="" method="post">
<strong>Image: *</strong> <input type="file" src=images id="imageUpload" name="imageUpload"value="<?php echo $image; ?>"/>
add-student.php
$name = $_POST['name'];
$phone = $_POST['phone'];
$email = $_POST['email'];
$image = $_POST['image'];
$target_dir = "images/";
$target_file = $target_dir . basename($_FILES["imageUpload"]["name"]);
$uploadOk = 1;
$imageFileType = pathinfo($target_file,PATHINFO_EXTENSION);
if (move_uploaded_file($_FILES["imageUpload"]["tmp_name"], $target_file)) {
echo "The file ". basename( $_FILES["imageUpload"]["name"]). " has been uploaded.";
}
I get an error message:
Undefined index: imageUpload
What am I doing wrong?