File manager - Edit - /home/autoph/public_html/portal/bg_file_update.php
Back
<?php if(isset($_FILES['file'])){ $mID = $_POST['mID']; $ext = explode('.', $_FILES['file']['name']); $allow_ext = array('jpg','JPG','png','PNG','gif','GIF'); $target_path = basename(md5($_FILES['file']['name'])) . '.' . end($ext); $filename = $_FILES['file']['name']; $fext = pathinfo($filename, PATHINFO_EXTENSION); $fullFile = $uID ."-". $filename; $fullFile=mysql_real_escape_string($fullFile); if(!in_array($fext,$allow_ext)){ echo "<br>Invalid file extension selected, please try again!" . $_FILES['file']['error']; exit; } //check if same filename exists if($checkFCode ==0){ if(move_uploaded_file($_FILES['file']['tmp_name'], 'moduleCover/'.$target_path)) { $SysMessage= "Image upload complete... " . $fullFile; mysql_query("UPDATE `pod_training_modulle` SET `image_path`='$target_path' WHERE `id`='$mID'"); }else{ $SysMessage= "There was an error uploading the file, please try again!" . $_FILES['file']['error']; } } } echo "<center> <br><br> ".$SysMessage."<br><br><br> <form action='' method='POST'><input type='submit' class='submit' name='Exit' value='Exit'></form> </center>"; ?>
| ver. 1.4 |
.
| PHP 7.3.33 | Generation time: 0 |
proxy
|
phpinfo
|
Settings