Advertisement
Guest User

Untitled

a guest
Aug 24th, 2016
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.93 KB | None | 0 0
  1. <html>
  2. <head>
  3. <title>asdf</title>
  4. <link rel="stylesheet" type="text/css" href="Background.css">
  5. </head>
  6. <?php
  7. session_start();
  8. if(!isset($_SESSION["login"]))
  9. header("location:admin.php");
  10. ?>
  11.  
  12. <body>
  13. <h1 style="color:white"><u><center></center></u></h1>
  14. <div id="BG"></div>
  15.  
  16. <form action = "update1.php" method = "GET">
  17. <table border = 0>
  18. <tr>
  19. <td>Image: <input type = "text" name = "image" id = "image"></td>
  20. <br/>
  21. <td>Hero Name: <input type = "text" name = "heroes" id = "heroes"></td>
  22. <br/>
  23. <td>Role: <input type = "text" name = "roles" id = "roles"></td>
  24. <br/>
  25. <td>Attribute: <input type = "text" name = "attribute" id = "attribute"></td>
  26. <br/>
  27. <td>Description: <input type = "text" name = "description" id = "description"></td>
  28. <br/>
  29. <td>General: <input type = "text" name = "general" id = "general"></td>
  30. <br/>
  31. </tr>
  32. </table>
  33. </br>
  34. <input type = "submit" name="update" value = "Update">
  35. </form>
  36. </center>
  37. </html>
  38.  
  39.  
  40.  
  41. <?php
  42. ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL);
  43. define("DB_USER","*****");
  44. define("DB_PASSWORD","****");
  45. define("DB_HOST","*****");
  46. define("DB_NAME","*****");
  47.  
  48. $dbc=mysqli_connect(DB_HOST,DB_USER,DB_PASSWORD,DB_NAME);
  49. if(isset($_GET['update']))
  50. {
  51.  
  52. $image = $_GET['image'];
  53. $heroes = $_GET['heroes'];
  54. $roles = $_GET['roles'];
  55. $attribute = $_GET['attribute'];
  56. $description = $_GET['description'];
  57. $general = $_GET['general'];
  58. $sql = "update `Dota 2 select` set (`image` = '$image',`heroes` = '$heroes') WHERE (heroes= '$heroes', image = '$image')";
  59. // $sql = "Update `Dota 2 select` SET (`image`= [$image]) = WHERE `image`)";
  60.  
  61. // $sql = "Update `Dota 2 select` SET (`image`= [$image],`heroes` =[$heroes],`roles` =[$roles],`attribute`=[$attribute],`description`=[$description],`general`=[$general]) = WHERE `heroes`='$heroes')";
  62. // $sql = "Update `Dota 2 select` SET (`image`= [$image],`heroes`,`roles`,`attribute`,`description`,`general`) = WHERE (`image`,`heroes`,`roles`,`attribute`,`description`,`general`) = ('$image','$heroes','$roles','$attribute','$description','$general')";
  63.  
  64. if(!mysqli_query($dbc, $sql))
  65. {
  66. echo(mysqli_error($dbc));
  67. }
  68. else
  69. {
  70. echo 'Data successfully updated!';
  71. }
  72. mysqli_close($dbc);
  73. }
  74.  
  75.  
  76. ?>
  77.  
  78. <?php
  79. define("DB_USER","********");
  80. define("DB_PASSWORD","********");
  81. define("DB_HOST","*********");
  82. define("DB_NAME","*********");
  83.  
  84. $dbc=mysqli_connect(DB_HOST,DB_USER,DB_PASSWORD,DB_NAME);
  85.  
  86. $Heroes = $_GET['Heroes'];
  87.  
  88. if( isset($_GET['Heroes']) )
  89. {
  90.  
  91. $sql= "update into `Dota 2 select` WHERE `Heroes`='$Heroes'";
  92. if(!mysqli_query($dbc, $sql))
  93. {
  94. echo(mysqli_error($dbc));
  95. }
  96. else
  97. {
  98. echo 'Data successfully updated!';
  99. echo "<meta http-equiv='refresh' content='0;url=adminupdate.php'>";
  100. }
  101. }
  102.  
  103. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement