Файловый менеджер - Редактировать - /home/carpe/public_html/BOOM/rep.php
Назад
<?php class Database { private $host = "localhost"; private $db_name = "carpe_boom"; private $username = "carpe_php"; private $password = "onestdestubesonestpasdespots"; private $conn; public function getConnection() { $this->conn = null; try { $this->conn = new PDO( "mysql:host=" . $this->host . ";dbname=" . $this->db_name, $this->username, $this->password ); $this->conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); } catch (PDOException $exception) { echo "Erreur de connexion : " . $exception->getMessage(); } return $this->conn; } } $database = new Database(); $connexion = $database->getConnection(); $cause = $_POST['toto']; if($cause == 'un'){ $lenght = $_POST['lenght']; $sql = "SELECT * from onomatope where nb='$lenght'"; $statement = $connexion->prepare($sql); $statement->execute(); $results = $statement->fetchAll(PDO::FETCH_ASSOC); foreach($results as $value){ $index = $value['id']; echo "<img src='$index.png'>"; } } if($cause == 'un.un'){ $lenght = $_POST['lenght']; $value = $_POST['value']; //echo $value; $sql = "SELECT * from onomatope where violence = '$value' and nb='$lenght'"; $statement = $connexion->prepare($sql); $statement->execute(); $results = $statement->fetchAll(PDO::FETCH_ASSOC); foreach($results as $value){ $index = $value['id']; echo "<img src='$index.png' >"; } } if($cause == 'un.deux'){ $lenght = $_POST['lenght']; $value = $_POST['value']; //echo $value; $sql = "SELECT * from onomatope where nb = '$lenght' ORDER BY classement ASC"; $statement = $connexion->prepare($sql); $statement->execute(); $results = $statement->fetchAll(PDO::FETCH_ASSOC); foreach($results as $value){ $index = $value['id']; echo "<img src='$index.png' >"; } } if($cause == 'un.deuxdeux'){ $lenght = $_POST['lenght']; $value = $_POST['value']; //echo $value; $sql = "SELECT * from onomatope where nb = '$lenght' ORDER BY classement DESC"; $statement = $connexion->prepare($sql); $statement->execute(); $results = $statement->fetchAll(PDO::FETCH_ASSOC); foreach($results as $value){ $index = $value['id']; echo "<img src='$index.png' >"; } } if($cause == 'un.trois'){ $value = $_POST['value']; $value2 = $_POST['value2']; if($value2 == 'moins'){ $sql = "SELECT * from onomatope where violence = '$value' ORDER BY classement DESC"; } if($value2 == "plus"){ $sql = "SELECT * from onomatope where violence = '$value' ORDER BY classement ASC"; } $statement = $connexion->prepare($sql); $statement->execute(); $results = $statement->fetchAll(PDO::FETCH_ASSOC); foreach($results as $value){ $index = $value['id']; echo "<img src='$index.png' >"; } } if($cause == 'deux'){ $value = $_POST['value']; //echo $value; $sql = "SELECT * from onomatope where violence = '$value'"; $statement = $connexion->prepare($sql); $statement->execute(); $results = $statement->fetchAll(PDO::FETCH_ASSOC); foreach($results as $value){ $index = $value['id']; echo "<img src='$index.png' >"; } } if($cause == 'trois'){ $value = $_POST['value2']; //echo $value; if($value == "plus"){ $sql = "SELECT * FROM `onomatope` ORDER BY classement ASC"; $statement = $connexion->prepare($sql); $statement->execute(); $results = $statement->fetchAll(PDO::FETCH_ASSOC); foreach($results as $value){ $index = $value['id']; echo "<img src='$index.png'>"; } } if($value == "moins"){ $sql = "SELECT * FROM `onomatope` ORDER BY classement DESC"; $statement = $connexion->prepare($sql); $statement->execute(); $results = $statement->fetchAll(PDO::FETCH_ASSOC); foreach($results as $value){ $index = $value['id']; echo "<img src='$index.png' >"; } } } if($cause == 'quatre'){ $sql = "SELECT * FROM `onomatope` "; $statement = $connexion->prepare($sql); $statement->execute(); $results = $statement->fetchAll(PDO::FETCH_ASSOC); foreach($results as $value){ $index = $value['id']; echo "<img src='$index.png'>"; } } if($cause == 'tout'){ $lenght = $_POST['lenght']; $value = $_POST['value']; $value2 = $_POST['value2']; if($value2 == "plus"){ $sql = "SELECT * FROM `onomatope` where nb='$lenght' and violence = '$value' ORDER BY classement ASC"; } if($value2 == "moins"){ $sql = "SELECT * FROM `onomatope` where nb='$lenght' and violence = '$value' ORDER BY classement DESC"; } $statement = $connexion->prepare($sql); $statement->execute(); $results = $statement->fetchAll(PDO::FETCH_ASSOC); foreach($results as $value3){ $index = $value3['id']; echo "<img src='$index.png'>"; } } ?>
| ver. 1.4 |
Github
|
.
| PHP 8.0.30 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка