Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if ($_POST['author'] != "" && $_POST['secretword'] != "" && $_POST['text'] != "")
- {
- $author = $_POST['author'];
- $password = $_POST['secretword'];
- $text = $_POST['text'];
- $con = mysql_connect('localhost', '313795_postmkr', '*U4WAqUb#264@pA');
- if (!$con)
- {
- die('Could not connect to database. MySQL error: ' . mysql_error());
- }
- $db = mysql_select_db('xura_zxq_main', $con);
- $result = mysql_query('SELECT * FROM xuradev WHERE Username==' . $author . 'AND Password==' . md5($password));
- if (!$result)
- {
- die('That username/password does not exist!');
- }
- $result = mysql_query('SELECT PostID FROM xurablog ORDER BY PostID DESC LIMIT 1');
- $idarray = mysql_fetch_array($result);
- $result = mysql_query('INSERT INTO xurablog VALUES (' . $idarray['id'] + 1 . ', ' . $author . ', ' . date("d.m.y") . ', ' . $text);
- if (!$result)
- {
- die("Could not post your new blog post! MySQL error: " . mysql_error());
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement