Guest User

Untitled

a guest
Apr 19th, 2018
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.21 KB | None | 0 0
  1. <html>
  2.  
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
  5. <meta name="GENERATOR" content="Microsoft FrontPage 4.0">
  6. <meta name="ProgId" content="FrontPage.Editor.Document">
  7. <title>Meridian 59 - News</title>
  8. </head>
  9.  
  10. <body background="images/m59_website_09.jpg">
  11.  
  12.  
  13. <font size="2" face="Arial" color="#FFFFFF">
  14. <h2>Checking username...</h2><br />
  15. <?php
  16. if ($_POST['password1'] == $_POST['password2']) {
  17. $user = strtolower($_POST['username']);
  18. $pw = $_POST['password1'];
  19. $datecreated = date("y-m-d H:i:s");
  20. $dbh = mysql_connect ("localhost", "meridian_333", "m59stillrocking")
  21. or die ('I cannot connect to the database because: ' . mysql_error());
  22. mysql_select_db ("meridian_333");
  23. $query = "select * from xxxx where user = '$user'";
  24. $result = mysql_query($query)
  25. or die ('I cannot connect to the database because: ' . mysql_error());
  26. $num_rows = mysql_num_rows($result);
  27. if ($num_rows == "0") {
  28. $data ="create automated $user $pw";
  29. $fp = fsockopen("127.0.0.1", "5374", $errno, $errstr, 2);
  30. if (!$fp) {
  31. echo "$errstr ($errno)<br />\n";
  32. } else {
  33. fwrite($fp, $data . "\r");
  34. stream_set_timeout($fp, 2);
  35. $results = array();
  36. $status = socket_get_status($fp);
  37. while (!feof($fp) && !$status['timed_out'])
  38. {
  39. $results[] = fgets($fp);
  40. $status = socket_get_status($fp);
  41. }
  42. fclose($fp);
  43. /*print_r($results);*/
  44. $query = "insert into xxxx(user,ip,date,pw)";
  45. $query = $query . "values('".$user."','".$_SERVER["REMOTE_ADDR"]."','".$datecreated."','".$pw."')";
  46. $result = mysql_query($query)
  47. or die ('I cannot connect to the database because: ' . mysql_error());
  48. mysql_close($dbh);
  49. echo "Account $user created sucesfully! <br />";
  50. }
  51. }
  52. else {
  53. echo "Username already exist, please pick another one";
  54. }
  55. }
  56. else {
  57. echo "Mismatch passwords";
  58. }
  59. ?>
  60. </tr>
  61. </table>
  62. </center>
  63. </div>
  64. </body>
Add Comment
Please, Sign In to add comment