Advertisement
Guest User

Untitled

a guest
Jul 5th, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. <?php
  2. $html = file_get_contents("guestbook.html");
  3. header("Content-type: text/html");
  4. if(isset($_POST['submit'])){
  5. header_remove("Content-type: text/plain");
  6. $username="usr_10746419";
  7. $password="746419";
  8. $database="db_10746419";
  9.  
  10. $name=$_POST['name'];
  11. $comment=$_POST['comment'];
  12. $email=$_POST['email'];
  13. $homepage=$_POST['homepage'];
  14.  
  15. $db = mysql_connect("atlas.dsv.su.se", $username,$password)
  16. or die("Unable to connect to sql server");
  17.  
  18. mysql_select_db($database,$db) or die("Unable to select database");
  19.  
  20. $query = "INSERT INTO guestbook (email, comment, name, surname, homepage)
  21. VALUES ('$email','$comment','$name','default','$homepage')";
  22. mysql_query($query,$db) or die("kek");
  23. echo "Using username :$username \n";
  24. echo "Using password :$password \n";
  25. echo "Using database :$database \n";
  26. }
  27. eval("print \"" . addcslashes(preg_replace("/(---(.+?)---)/", "\\2", $html), '"') . "\";");
  28. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement