Advertisement
Guest User

edit

a guest
Mar 3rd, 2015
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.97 KB | None | 0 0
  1. <meta content="noindex, nofollow" name="robot">
  2. <link href="public/css/style_delete.css" rel="stylesheet" type="text/css">
  3. <div class="maindiv">
  4. <div class="divA">
  5. <div class="title">
  6. <h2>Update Data Using PHP</h2>
  7. </div>
  8. <div class="divB">
  9. <div class="divD">
  10. <p>Click On Menu</p>
  11. <?php
  12. require_once "sql/connect.php";
  13. if (isset($_GET['submit'])) {
  14. $id = $_GET['id'];
  15. $place = $_GET['place'];
  16. $time = $_GET['time'];
  17. $text = $_GET['text'];
  18. $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());
  19. }
  20. $query = mysql_query("SELECT * from actions");
  21. while ($row = mysql_fetch_array($query)) {
  22. echo "<b><a href='admin.php?adm=edit_post&amp;update={$row['id']}'>{$row['place']}</a></b>";
  23. echo "<br />";
  24. }
  25. ?>
  26. </div><?php
  27. if (isset($_GET['update'])) {
  28. $update = $_GET['update'];
  29. $query1 = mysql_query("SELECT * from actions where id=$update");
  30. while ($row1 = mysql_fetch_array($query1)) {
  31. echo "<form class='form' method=\"GET\">";
  32. echo "<h2>---Details---</h2>";
  33. echo "<hr/>";
  34. echo"<input class='input' type='hidden' name='id' value='{$row1['id']}' />";
  35. echo "<br />";
  36. echo "<label>" . "Name:" . "</label>" . "<br />";
  37. echo"<input class='input' type='text' name='place' value='{$row1['place']}' />";
  38. echo "<br />";
  39. echo "<label>" . "Email:" . "</label>" . "<br />";
  40. echo"<input class='input' type='text' name='time' value='{$row1['time']}' />";
  41. echo "<br />";
  42. echo "<label>" . "Address:" . "</label>" . "<br />";
  43. echo "<textarea rows='4' cols='76' name='text'>{$row1['text']}";
  44. echo "</textarea>";
  45. echo "<br />";
  46. echo "<input class='button' type='submit' name='submit' value='Edit' />";
  47. echo "</form>";
  48. }
  49. }
  50. if (isset($_GET['submit'])) {
  51. echo '<div class="form" id="form3"><br><br><br><br><br><br>
  52. <Span>Data Updated Successfuly......!!</span></div>';
  53. }
  54. ?>
  55. <div class="clear"></div>
  56. </div>
  57. <div class="clear"></div>
  58. </div>
  59. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement