Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <meta content="noindex, nofollow" name="robot">
- <link href="public/css/style_delete.css" rel="stylesheet" type="text/css">
- <div class="maindiv">
- <div class="divA">
- <div class="title">
- <h2>Update Data Using PHP</h2>
- </div>
- <div class="divB">
- <div class="divD">
- <p>Click On Menu</p>
- <?php
- require_once "sql/connect.php";
- if (isset($_GET['submit'])) {
- $id = $_GET['id'];
- $place = $_GET['place'];
- $time = $_GET['time'];
- $text = $_GET['text'];
- $query = mysql_query("UPDATE actions set place='". $_GET['place'] ."', time='". $_GET['time'] ."', text='". $_GET['text'] ."' where id='". $_GET['id'] ."'")or die("Query failed: " . mysql_error());
- }
- $query = mysql_query("SELECT * from actions");
- while ($row = mysql_fetch_array($query)) {
- echo "<b><a href='admin.php?adm=edit_post&update={$row['id']}'>{$row['place']}</a></b>";
- echo "<br />";
- }
- ?>
- </div><?php
- if (isset($_GET['update'])) {
- $update = $_GET['update'];
- $query1 = mysql_query("SELECT * from actions where id=$update");
- while ($row1 = mysql_fetch_array($query1)) {
- echo "<form class='form' method=\"GET\">";
- echo "<h2>---Details---</h2>";
- echo "<hr/>";
- echo"<input class='input' type='hidden' name='id' value='{$row1['id']}' />";
- echo "<br />";
- echo "<label>" . "Name:" . "</label>" . "<br />";
- echo"<input class='input' type='text' name='place' value='{$row1['place']}' />";
- echo "<br />";
- echo "<label>" . "Email:" . "</label>" . "<br />";
- echo"<input class='input' type='text' name='time' value='{$row1['time']}' />";
- echo "<br />";
- echo "<label>" . "Address:" . "</label>" . "<br />";
- echo "<textarea rows='4' cols='76' name='text'>{$row1['text']}";
- echo "</textarea>";
- echo "<br />";
- echo "<input class='button' type='submit' name='submit' value='Edit' />";
- echo "</form>";
- }
- }
- if (isset($_GET['submit'])) {
- echo '<div class="form" id="form3"><br><br><br><br><br><br>
- <Span>Data Updated Successfuly......!!</span></div>';
- }
- ?>
- <div class="clear"></div>
- </div>
- <div class="clear"></div>
- </div>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement