File manager - Edit - /home/familylifersmpc/htdocs/www.familylifersmpc.com/upload_mobile.php
Back
<?php //start PHP session session_start(); include('includes/conn.php'); include('includes/config.php'); //check if register form is submitted $sid = $_SESSION['alogin']; if(strlen($_SESSION['alogin'])=="") { header("Location: login.php"); } else{ $target_path = "Verification/"; $target_pathFinal = $target_path . basename( $_FILES["uploadedfile"]["name"]); if(isset($_POST['register'])){ if(move_uploaded_file($_FILES["uploadedfile"]["tmp_name"], $target_pathFinal)) { rename("Verification/" . basename( $_FILES["uploadedfile"]["name"]) ,"Verification/" . $sid. uniqid() . '.jpg'); $sql = "SELECT cname FROM users WHERE uname='". $sid. "'"; $query = $dbh->prepare($sql); $query->execute(); $results=$query->fetchAll(PDO::FETCH_OBJ); $cnt=1; if($query->rowCount() > 0) { foreach($results as $result) { }} //assign variables to post values $userID = $_SESSION['alogin']; $name = $result->cname; $description = $_POST['description']; $principal = $_POST['principal']; $terms = $_POST['terms']; $paymentmode = $_POST['paymentmode']; $status = "PENDING"; $IMG = basename( $_FILES["uploadedfile"]["name'"]); $str1 = $principal; $x = str_replace( ',', '', $str1); if( is_numeric($x)) { echo $x."\n"; } $principal = $x; //insert new loan to our database $stmt = $pdo->prepare('INSERT INTO tblloanapp (description, principal, terms, paymentmode, name, userID, status, IMG) VALUES (:description, :principal, :terms, :paymentmode, :name, :userID, :status, :IMG)'); try{ $stmt->execute(['description' => $description, 'principal' => $principal, 'terms' => $terms, 'paymentmode' => $paymentmode, 'name' => $name, 'userID' => $userID, 'status' => $status, 'IMG' => $IMG]); $_SESSION['success'] = 'Loan application successfully submitted!'; } catch(PDOException $e){ $_SESSION['error'] = 'Loan application submission failed! Try again. <br> Click "<strong>Applied Loans</strong>" to check loan status!'; } } else{ $_SESSION['error'] = 'Loan application submission failed! Try again. <br> Click "<strong>Applied Loans</strong>" to check loan status!'; } header('location: dashboard.php'); } else{ echo "There was an error uploading the file, please try again!"; } } ?>
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.02 |
proxy
|
phpinfo
|
Settings