Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!doctype html>
- <html lang="ru">
- <head>
- <title>Админ-панель</title>
- </head>
- <body>
- help me
- <form method="POST"><p>Введите имя таблицы</p>
- <input type="text" name="table">
- <p>Введите id телефона</p>
- <input type="number" name="id">
- <p>Введите цену</p>
- <input type="number" name="price">
- <button type="submit"></button>
- </form>
- <?php
- require '../connect.php';
- if(isset($_POST['price']) && isset($_POST['table']) && isset($_POST['id'])){
- $id = htmlentities(mysqli_real_escape_string($connection, $_POST['id']));
- $price = htmlentities(mysqli_real_escape_string($connection, $_POST['price']));
- $table = htmlentities(mysqli_real_escape_string($connection, $_POST['table']));
- $query ="UPDATE $table SET price = '$price' WHERE id = $id";
- $result = mysqli_query($connection, $query) or die("Ошибка " . mysqli_error($connection));
- if($result)
- echo "<span style='color:blue;'>Данные обновлены</span>";
- }
- ?>
Add Comment
Please, Sign In to add comment