Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>Dota 2 | Admin Panel</title>
- <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!">
- <meta type="keywords" content="Dota 2, Valve Dota 2, Dota2, Dota 2, Icefrog, Dota 2 News, Dota News">
- <meta name="google-site-verification" content="aZIJIXhC2PxDKEnwcsW21WlRCOlLu3rLZ1XX93V-sPY" />
- </head>
- <body>
- <h2>Dota Two <br> Administration Panel</h2>
- <div id="wrapper" style="width:800px; height:auto; margin-left:100px;">
- <form method="post">
- <table>
- <tr> <td>Title:</td> <td colspan="3"><input name="post_title" type="text" size="25" /></td> </tr>
- <tr> <td>Permalink:</td colspan="3"> <td><input name="post_permalink" type="text" size="35" /></td> </tr>
- <tr> <td>Post:</td> <td colspan="3"><textarea name="post_text" rows="15" cols="58"> Insert post here. </textarea></td> </tr>
- <tr> <td>Summary:</td> <td colspan="3"><textarea name="post_brief" rows="10" cols="58"> Insert summary here. </textarea></td> </tr>
- <tr> <td>Decription:</td> <td colspan="3"><textarea name="post_desc" rows="2" cols="58"> Insert description here. </textarea></td> </tr>
- <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>
- </table>
- </form>
- <?php
- $db = new mysqli('localhost', 'eosfors_dota2un', 'aceOs666', 'eosfors_dota2');
- $mysqlStr = 'SELECT * FROM custom_single_posts
- LIMIT 10
- ORDER BY post_id DESC';
- $res = $db->query($mysqlStr);
- while($row = $res->fetch_assoc()){
- echo $row['post_id'];
- }
- $res->close();
- ?>
- <br>
- <br>
- <?php
- if(!empty($_POST['submit'])){
- // $db = new mysqli('localhost', 'eosfors_dota2un', 'aceOs666', 'eosfors_dota2');
- $mysqlStr = sprintf("INSERT INTO
- custom_single_posts (post_id, post_title, post_text, post_brief, post_desc, post_permalink)
- VALUES (null, '%s', '%s', '%s', '%s', '%s')
- ",
- $db->real_escape_string($_POST['post_title']),
- $db->real_escape_string($_POST['post_text']),
- $db->real_escape_string($_POST['post_brief']),
- $db->real_escape_string($_POST['post_desc']),
- $db->real_escape_string($_POST['post_permalink'])
- );
- if(!$db->query($mysqlStr))
- printf("Errormessage: %s\n", $db->error);
- else
- echo 'Post added with id: ' . $db->insert_id;
- }
- ?>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement