Guest User

Untitled

a guest
Jul 20th, 2016
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. <?php
  2.  
  3. $servername = "68.178.253.26";
  4. $username = "d8382639921729";
  5. $password = "tp#3JPSvW-u@";
  6.  
  7. try
  8. {
  9. $conn = new PDO("mysql:host=$servername;dbname=d8382639921729;port=3308", $username, $password);
  10. $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
  11. }
  12. catch(PDOException $e)
  13. {
  14. echo "Connection failed: " . $e->getMessage();
  15. exit;
  16. }
  17.  
  18. $from_user = $_POST["from_user"];
  19. $code = $_POST["code"];
  20. $description = $_POST["description"];
  21. $message = $_POST["message"];
  22.  
  23. $user_to = $conn->prepare("SELECT user_id FROM wp_58qqty3rx3_lostcode WHERE lostcode_code='".$code."'")
  24. $user_to->queryString();
  25.  
  26. $statement = $conn->prepare("INSERT INTO wp_58qqty3rx3_fep_messages
  27. (from_user, to_user, message_title, message_contents)
  28. VALUES (?,?,?,?)");
  29.  
  30. if ($statement->execute(array($from_user,$user_to,$description,$message)))
  31. {
  32. echo "New record created successfully";
  33. } else {
  34. echo "Error: " . $sql . "<br>" . mysqli_error($conn);
  35. }
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42. ?>
Add Comment
Please, Sign In to add comment