X

Create New Item

File Folder

X

Search Results

File "upload.php"

Full path: /home/meharicl/www/bilan/upload.php
File size: 2.18 KiB (2237 bytes)
MIME-type: text/html
Charset: 8 bit

Download   Open   Edit   Advanced Edit   Back

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>

<head>
<title>Sans Titre</title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<meta name="generator" content="HAPedit 3.1">
</head>
<body bgcolor="#FFFFFF">
<?
$link = mysqli_connect("meharicltest.mysql.db", "meharicltest", "Pva131254", "meharicltest");
if (!$link) {                                                                                                
    echo "Erreur : Impossible de se connecter  MySQL." . PHP_EOL;                                           
    echo "Errno de dbogage : " . mysqli_connect_errno() . PHP_EOL;                                          
    echo "Erreur de dbogage : " . mysqli_connect_error() . PHP_EOL;                                         
    exit;}
  // Your code here
  echo "<hr />\n".
       "HAPedit 3.1.11.111 (septembre 2021 15:54:28)****************";
//print_r($_FILES);echo('***<br>');
//print_r($_POST);
//$tempname=$_FILES['file']['tmp_name'];
//echo( $tempname);
move_uploaded_file($_FILES['file']['tmp_name'], "bdd.sql");
$handle = @fopen("bdd.sql", "r");
if ($handle) {
    $link->query("DROP TABLE `activity`, `affectation`, `bill`, `card`, `channel`, `compte`, `exercice`, `fee`, `member`, `note`, `organisation`, `product`, `purchase`, `reference`, `view`, `wooLink`, `wooOrder`;");
    while (($buffer = fgets($handle)) !== false) {
          $sql=utf8_encode($buffer);
          $link->query($sql);
        //echo $sql."<br>";
    }                                                                                           
    if (!feof($handle)) {
        echo "Erreur: fgets() a chou\n";
    }
    fclose($handle);
    unlink("bdd.sql");
    //mise a jour exercice
   $sql="UPDATE `encours` SET `id_exercice` = '".$_POST['exercice']."' WHERE `encours`.`id` = 1";
   //echo($sql);
   $link->query($sql);
   $sql="UPDATE `encours` SET `id_exercice` = '".date("Y-m-d h:i ")."' WHERE `encours`.`id` = 2";
   //echo($sql);
   $link->query($sql);
 // header('Location: index.php');
 }
 ?>
 <script>
window.location.assign("index.php");
</script>



</body>

</html>