Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.02 KB | None | 0 0
  1. <?php
  2.     $outcome = "";
  3.     if ($_POST['author'] != "" && $_POST['secretword'] != "" && $_POST['text'] != "")
  4.     {
  5.         $author = $_POST['author'];
  6.         $password = $_POST['secretword'];
  7.         $text = $_POST['text'];
  8.        
  9.         $con = mysql_connect('localhost', '313795_postmkr', '*U4WAqUb#264@pA');
  10.         if (!$con)
  11.         {
  12.             die("Could not connect to database. MySQL error: " . mysql_error());
  13.         }
  14.        
  15.         $query = "SELECT * FROM xuradev WHERE Username==" . $author . "";
  16.         $db = mysql_select_db("xura_zxq_main", $con);
  17.         $result = mysql_query($query);
  18.         if (!$result)
  19.         {
  20.             die("That username/password does not exist!");
  21.         }
  22.        
  23.         $result = mysql_query("SELECT PostID FROM xurablog ORDER BY PostID DESC LIMIT 1");
  24.         $idarray = mysql_fetch_array($result);
  25.         $currentdate = date("Y-m-d");
  26.        
  27.         $result = mysql_query("INSERT INTO xurablog VALUES (1, '$author', '$currentdate', '$text')");
  28.         if (!$result)
  29.         {
  30.             die("Could not post your new blog post! MySQL error: " . mysql_error());
  31.         }
  32.        
  33.         $outcome = "Successfully posted! <br /> <br />";
  34.     }
  35. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement