File manager - Edit - /home/autoph/public_html/connect/home/load_profile_pic.php
Back
<?php $connect_error = 'Sorry, we\'re experiencing connection problem. Please try again later... Thank you!'; mysql_connect('localhost','root','aee1024') or die ($connect_error); mysql_select_db('db_vts') or die($connect_error); //error_reporting(1); $tDate = date_create() ->format("Y/m/d"); $tTime =Explode(":", date('H:i:s')); $svtTime = $tTime[0].":".$tTime[1].":".$tTime[1]; if(isset($_POST['done'])){ $custID =mysql_escape_string($_POST['custID']); $ext = explode('.', $_FILES['file']['name']); $allow_ext = array('PNG','png','JPG' ,'jpg','GIF', 'gif'); $target_path = basename( $_FILES['file']['name']); $target_path = mysql_real_escape_string($target_path); $filename = $_FILES['file']['name']; $fext = pathinfo($filename, PATHINFO_EXTENSION); echo $custID .'ID <br>'; echo $filename .'name <br>'; echo $fext .'fext <br>'; if(!in_array($fext,$allow_ext)){ $SysMessage='Invalid file extension. Please select image format only...'; $ror=true; }else { if(move_uploaded_file($_FILES['file']['tmp_name'], 'MyProfilePicture/'.$custID.'_'.$target_path)) { $myFile = $custID ."_" . $filename; $fullFile=mysql_real_escape_string($myFile); //duplicate image is not allowed mysql_query("DELETE FROM `vts_profile_images` WHERE `cust_id`='$custID'"); $sql="INSERT INTO `vts_profile_images` (`pro_id`,`cust_id`,`file_path`) VALUES('','$custID','$fullFile')"; if(!mysql_query($sql)) { die('Error: ' . mysql_error()); }else{ $SysMessage= "Image upload complete... " . $fullFile; } //echo "<center> " ."The file ". " " . basename( $_FILES['file']['name']). " " . //" has been uploaded</center>"; //echo "<font size = '2em' color='gray'> Selected filename : " . $_FILES['file']['name'] . "<font><br>"; //echo "<font size = '2em' color='gray'> File Type: " . $_FILES['file']['type'] . "<font><br>"; //echo "<font size = '2em'> File Extension: " . $ext[1] . "<font><br>"; //echo "<font size = '2em'> Temporary File: " . $_FILES['file']['tmp_name'] . "<font><br>"; //echo "<font size = '2em'> File size: " . $_FILES['file']['size'] . "KB<font><br>"; }else{ $SysMessage= "There was an error uploading the file, please try again!" . $_FILES['file']['error']; } } exit(); } ?>
| ver. 1.4 |
.
| PHP 7.3.33 | Generation time: 0 |
proxy
|
phpinfo
|
Settings