Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $outcome = "";
- 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());
- }
- $query = "SELECT * FROM xuradev WHERE Username==" . $author . "";
- $db = mysql_select_db("xura_zxq_main", $con);
- $result = mysql_query($query);
- 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);
- $currentdate = date("Y-m-d");
- $result = mysql_query("INSERT INTO xurablog VALUES (1, '$author', '$currentdate', '$text')");
- if (!$result)
- {
- die("Could not post your new blog post! MySQL error: " . mysql_error());
- }
- $outcome = "Successfully posted! <br /> <br />";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement