Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if(isset($_POST['update']))
- {
- $hostname = "localhost";
- $username = "root";
- $password = "";
- $databaseName = "postai";
- $connect = mysqli_connect($hostname, $username, $password, $databaseName);
- $img = $_POST['img'];
- $tekstas = $_POST['tekstas'];
- $autorius= $_POST['autorius'];
- $query = "UPDATE news SET tekstas='$tekstas.' ";
- $result = mysqli_query($connect, $query);
- if($result)
- {
- echo 'Atnaujinta<br><br><br>';
- }else{
- echo 'Neatnaujinta';
- }
- mysqli_close($connect);
- }
- ?>
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- </head>
- <body>
- <form action="atnaujinti.php" method="post">
- Tekstas: <input type="text" name="tekstas"><br><br>
- Autorius: <input type="text" name="autorius"><br><br>
- IMG URL: <input type="text" name="img"><br><br>
- <input type="submit" name="update" value="Atnaujinti">
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement