Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>zmiana linku</title>
- </head>
- <body>
- <?php
- $canProceed = true;
- if(empty($_GET['linkID'])){$canProceed = false;}
- if($canProceed)
- {
- $linkID = $_GET['linkID'];
- $conn = mysqli_connect('localhost','root','','linki');
- $q = mysqli_query($conn,"SELECT * FROM linki WHERE id=".$linkID.";");
- $a = mysqli_fetch_array($q);
- echo "<form method='POST' action=''>";
- echo "<input name='newLink' type='text' value='".$a['zawartosc']."'>";
- echo "<button type='submit'>PotwierdΕΊ zmiany</button>";
- echo "</form>";
- }
- if(empty($_POST['newLink'])){$canProceed = false;}
- if($canProceed)
- {
- $newLink = $_POST['newLink'];
- $q = mysqli_query($conn,"UPDATE `linki` SET `zawartosc` = '".$newLink."' WHERE `linki`.`id` = ".$linkID.";");
- echo "Zmieniono link o ID: ".$linkID." na: ".$newLink;
- header('Location: ignaczak.php');
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement