Advertisement
Guest User

Untitled

a guest
Jul 11th, 2017
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.86 KB | None | 0 0
  1. <html>
  2.  
  3. <head>
  4.  
  5. <title>Dota 2 | Admin Panel</title>
  6.  
  7. <meta type="description" content="Learn all the latest news of Dota 2, Valve and Icefrog and have the opportunity to try first the Dota 2 Beta!">
  8. <meta type="keywords" content="Dota 2, Valve Dota 2, Dota2, Dota 2, Icefrog, Dota 2 News, Dota News">
  9. <meta name="google-site-verification" content="aZIJIXhC2PxDKEnwcsW21WlRCOlLu3rLZ1XX93V-sPY" />
  10.  
  11. </head>
  12.  
  13. <body>
  14.  
  15. <h2>Dota Two <br> Administration Panel</h2>
  16.  
  17. <div id="wrapper" style="width:800px; height:auto; margin-left:100px;">
  18.  
  19. <form method="post">
  20. <table>
  21. <tr> <td>Title:</td> <td colspan="3"><input name="post_title" type="text" size="25" /></td> </tr>
  22. <tr> <td>Permalink:</td colspan="3"> <td><input name="post_permalink" type="text" size="35" /></td> </tr>
  23. <tr> <td>Post:</td> <td colspan="3"><textarea name="post_text" rows="15" cols="58"> Insert post here. </textarea></td> </tr>
  24. <tr> <td>Summary:</td> <td colspan="3"><textarea name="post_brief" rows="10" cols="58"> Insert summary here. </textarea></td> </tr>
  25. <tr> <td>Decription:</td> <td colspan="3"><textarea name="post_desc" rows="2" cols="58"> Insert description here. </textarea></td> </tr>
  26. <tr> <td colspan="4"><input type="button" value="Click me!" onclick="JavaScript:alert('Thanks... I feel much better now!')" /> <input type="button" value="Click me!" onclick="JavaScript:alert('Thanks... I feel much better now!')" /> <input type="button" value="Click me!" onclick="JavaScript:alert('Thanks... I feel much better now!')" /> <input type="submit" name="submit"/> </tr>
  27. </table>
  28. </form>
  29.  
  30. <?php
  31. $db = new mysqli('localhost', 'eosfors_dota2un', 'aceOs666', 'eosfors_dota2');
  32. $mysqlStr = 'SELECT * FROM custom_single_posts
  33. LIMIT 10
  34. ORDER BY post_id DESC';
  35. $res = $db->query($mysqlStr);
  36. while($row = $res->fetch_assoc()){
  37. echo $row['post_id'];
  38. }
  39. $res->close();
  40. ?>
  41.  
  42. <br>
  43. <br>
  44.  
  45. <?php
  46. if(!empty($_POST['submit'])){
  47. // $db = new mysqli('localhost', 'eosfors_dota2un', 'aceOs666', 'eosfors_dota2');
  48.  
  49. $mysqlStr = sprintf("INSERT INTO
  50. custom_single_posts (post_id, post_title, post_text, post_brief, post_desc, post_permalink)
  51. VALUES (null, '%s', '%s', '%s', '%s', '%s')
  52. ",
  53. $db->real_escape_string($_POST['post_title']),
  54. $db->real_escape_string($_POST['post_text']),
  55. $db->real_escape_string($_POST['post_brief']),
  56. $db->real_escape_string($_POST['post_desc']),
  57. $db->real_escape_string($_POST['post_permalink'])
  58. );
  59. if(!$db->query($mysqlStr))
  60. printf("Errormessage: %s\n", $db->error);
  61. else
  62. echo 'Post added with id: ' . $db->insert_id;
  63.  
  64. }
  65. ?>
  66.  
  67.  
  68.  
  69.  
  70. </div>
  71.  
  72. </body>
  73.  
  74. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement