ok
Direktori : /home/shopnoc1/www/ |
Current File : /home/shopnoc1/www/update.php |
<?php /** Inserting Data by for Student Admission start**/ include('db.php'); if (isset($_POST['changeinfo'])) { /** $err=0; $msg=""; **/ $id=$_POST["id"]; $entrydate=$_POST["entrydate"]; $admissiondate=$_POST["admissiondate"]; $stdid=$_POST["stdid"]; $name=$_POST["nm"]; $fname=$_POST["fnm"]; $mname=$_POST["mnm"]; $dob=$_POST["dob"]; $email=$_POST["email"]; $divs=$_POST["div"]; $diss=$_POST["dis"]; $upz=$_POST["upz"]; $gender=$_POST["gen"]; $course=$_POST["course"]; $ctime=$_POST["ctime"]; $phone=$_POST["phone"]; $stdstatus=$_POST["stdstatus"]; $cerstatus=$_POST["cerstatus"]; $docstatus=$_POST["docstatus"]; $cfee=$_POST["cfee"]; $tpay=$_POST["tpay"]; $due=$_POST["due"]; $examstatus=$_POST["examstatus"]; $result=$_POST["result"]; $filename = strtolower($_FILES['file']['name']); $ext=pathinfo($filename,PATHINFO_EXTENSION); $tmp_name = $_FILES['file']['tmp_name']; $target_dir = "images/student/"; $sqlstd = "SELECT * FROM admittedstudentinfo WHERE id =$id"; $resultstd = $conn->query($sqlstd); if ($resultstd->num_rows > 0) { // output data of each row while($rowstd = $resultstd->fetch_assoc()) { if ($filename=="") { $target_file=$rowstd['picture']; } else{ unlink($rowstd["picture"]); $target_file = $target_dir.$stdid.".".$ext; } } // code... } $target_file=strtolower($target_file); /** if ($ext!="jpg" || $ext !="png" || $ext !="jpeg") { echo "file format not supported"; // code... } else{ **/ move_uploaded_file($_FILES["file"]["tmp_name"],$target_file); /** } **/ /** if($name==""){ $err++; $msg="Please Enter Your Name"; } else if($fname==""){ $err++; $msg="Please Enter Your Father's Name"; } else if($mname==""){ $err++; $msg="Please Enter Your Mother's Name"; } else if($by==""){ $err++; $msg="Please Enter Your Birth Year"; } else if($course==0){ $err++; $msg="Please Select a Course"; } else if($phone==""){ $err++; $msg="Please Enter Phone Number"; } **/ $update = mysqli_query($conn,"update admittedstudentinfo SET entrydate='$entrydate',admissiondate='$admissiondate',stdid='$stdid',name='$name',fathername='$fname',mothername='$mname',dob='$dob',email='$email',division='$divs',district='$diss',upazilla='$upz',gender='$gender',course='$course',classtime='$ctime',phone='$phone',picture='$target_file',stdstatus='$stdstatus',certstatus='$cerstatus',docsub='$docstatus',coursefee='$cfee',totalpayment='$tpay',due='$due',examstatus='$examstatus',result='$result' where id='$id'"); if ($update) { // code... session_start(); Header( 'Location: dashboard.php'); $_SESSION["message"]="message of success"; } } ?>