Advertisement
Guest User

Untitled

a guest
Sep 25th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 5.17 KB | None | 0 0
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type"
  5. content="text/html; charset=iso-8859-1">
  6. <meta name="robots" content="INDEX,FOLLOW">
  7. <meta name="keywords"
  8. content="">
  9. <meta name="description"
  10. <title></title>
  11. <link rel="stylesheet" href="format.css" type="text/css">
  12.  
  13.  
  14.  
  15.  
  16. </head>
  17. <body     >
  18.  
  19.  
  20. <table width="86%" align="center"  cellspacing="0" cellpadding="0" border="0"  >
  21. <tr>
  22. <td  class="li">&nbsp;</td><td  >
  23. <!--ende aussentab-->
  24.  
  25.  
  26. <table align="center"  width="100%"     border="0" cellpadding="0" cellspacing="0"  >
  27. <tr>
  28.  <td><table align="right"  style="border-left:solid 1px #343434;"   id="menu2"  border="0" cellpadding="0" cellspacing="0"    >
  29. <tr>
  30.  
  31. <td ><a href="Login.html" onfocus="this.blur()">Memberbereich</a></td>
  32. <td ><a href="login.html" onfocus="this.blur()">Private Fotos</a></td>
  33. <td ><a href="Login.html" onfocus="this.blur()">G&auml;stebuch</a></td>
  34. <td ><a href="Impressum.html"  onfocus="this.blur()">Impressum</a></td>
  35.  
  36.  
  37.  
  38.  
  39. </tr>
  40. </table>
  41. <!-- ende menü oben--> </td>
  42. </tr>
  43.  
  44. <tr>
  45. <td    id="top"    >&nbsp;</td>
  46. </tr>
  47. <tr>
  48. <td   width="100%"     id="leiste1" ><!--menü oben-->
  49. &nbsp; &nbsp;
  50. <!-- ende menü oben--></td>
  51. </tr>
  52. </table>
  53.  
  54.  
  55.  
  56. <!--ende oben-->
  57.  
  58. <table align="center"  width="100%"     border="0" cellpadding="0" cellspacing="0"  >
  59.  
  60. <tr>
  61. <td  id="sp1" valign="top"     >
  62.  
  63. <!--  menü links-->
  64.  
  65. <table     align="center"  id="menu1"  border="0" cellpadding="0" cellspacing="0"   >
  66.  
  67. <tr>
  68. <td >
  69. <a href="index.php"  onfocus="this.blur()">&nbsp;&nbsp;Home</a></td>
  70. </tr>
  71. <tr>
  72. <td >
  73. <a href="kontakt.php"  onfocus="this.blur()">&nbsp;&nbsp;Kontakt</a></td>
  74. </tr>
  75. <tr>
  76. <td >
  77. <a href="login.php"  onfocus="this.blur()">&nbsp;&nbsp;Members-Bereich</a></td>
  78. </tr><tr>
  79. <td >
  80. <a href="gallerie.php" onfocus="this.blur()">&nbsp;&nbsp;Foto-Gallerie</a></td>
  81. </tr>
  82. <tr>
  83. <td >
  84. <a href="login.php" onfocus="this.blur()">&nbsp;&nbsp;Login</a></td>
  85. </tr>
  86. <tr>
  87. <td >
  88. <a href="register.php" onfocus="this.blur()">&nbsp;&nbsp;Registriere dich jetzt!</a></td>
  89. </tr>
  90. <tr>
  91. <td >
  92. <a href="partner.php" onfocus="this.blur()">&nbsp;&nbsp;Weitere Links</a></td>
  93. </tr >
  94. <tr>
  95. <td >
  96. <!-- ende menü links-->
  97.  
  98.  
  99. </table>
  100.  
  101. <div  style="margin-top:1px;background-image:url(images/ob.jpg);background-repeat:repeat-x;">&nbsp;</div>
  102.  
  103.  
  104. </td>
  105. <td valign="top"  id="sp2">
  106.  
  107. <h2>Anmeldung</h2>
  108.  
  109.  
  110. <?php
  111.  // Connects to your Database
  112.  
  113.  $db_server ="localhost";
  114.  $db_user   ="";
  115.  $db_pass   ="";
  116.  $db        ="";
  117.  
  118.  mysql_connect($db_server,$db_user,$db_pass) or die(mysql_error());
  119.  
  120.  mysql_select_db($db) or die(mysql_error());
  121.  
  122.  
  123.  //This code runs if the form has been submitted
  124.  
  125.  if (isset($_POST['submit'])) {
  126.  
  127.  
  128.  
  129.  //This makes sure they did not leave any fields blank
  130.  
  131.  if (!$_POST['username'] | !$_POST['pass'] | !$_POST['pass2'] ) {
  132.  
  133.         die('You did not complete all of the required fields');
  134.  
  135.     }
  136.  
  137.  
  138.  
  139.  // checks if the username is in use
  140.  
  141.     if (!get_magic_quotes_gpc()) {
  142.  
  143.         $_POST['username'] = addslashes($_POST['username']);
  144.  
  145.     }
  146.  
  147.  $usercheck = $_POST['username'];
  148.  
  149.  $check = mysql_query("SELECT username FROM users WHERE username = '$usercheck'")
  150.  
  151. or die(mysql_error());
  152.  
  153.  $check2 = mysql_num_rows($check);
  154.  
  155.  
  156.  
  157.  //if the name exists it gives an error
  158.  
  159.  if ($check2 != 0) {
  160.  
  161.         die('Sorry, the username '.$_POST['username'].' is already in use.');
  162.  
  163.                 }
  164.  
  165.  
  166.  // this makes sure both passwords entered match
  167.  
  168.     if ($_POST['pass'] != $_POST['pass2']) {
  169.  
  170.         die('Your passwords did not match. ');
  171.  
  172.     }
  173.  
  174.  
  175.  
  176.     // here we encrypt the password and add slashes if needed
  177.  
  178.     $_POST['pass'] = md5($_POST['pass']);
  179.  
  180.     if (!get_magic_quotes_gpc()) {
  181.  
  182.         $_POST['pass'] = addslashes($_POST['pass']);
  183.  
  184.         $_POST['username'] = addslashes($_POST['username']);
  185.  
  186.             }
  187.  
  188.  
  189.  
  190.  // now we insert it into the database
  191.  
  192.     $passwort = $_POST['pass'];
  193.     $name = $_POST['username'];
  194.     $insert = "INSERT INTO users (`username, `password`) VALUES ('$name', '$passwort')";
  195.  
  196.     $add_member = mysql_query($insert);
  197.     mkdir("./html/phoBNC/users/".$name, 0777);
  198.     ?>
  199.  
  200.  
  201.  
  202.  
  203.  <h1>Registered</h1>
  204.  
  205.  
  206.  <p>Thank you, you have registered - you may now <a href=login.php>login</a>.</p>
  207.  
  208. <?php
  209.  }
  210.  
  211.  else
  212.  { 
  213.  ?>
  214.  
  215.  
  216.  
  217.  <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
  218.  
  219.  <table border="0">
  220.  
  221.  <tr><td>Username:</td><td>
  222.  
  223.  <input type="text" name="username" maxlength="60">
  224.  
  225.  </td></tr>
  226.  
  227.  <tr><td>Password:</td><td>
  228.  
  229.  <input type="password" name="pass" maxlength="10">
  230.  
  231.  </td></tr>
  232.  
  233.  <tr><td>Confirm Password:</td><td>
  234.  
  235.  <input type="password" name="pass2" maxlength="10">
  236.  
  237.  </td></tr>
  238.  
  239.  <tr><th colspan=2><input type="submit" name="submit"
  240. value="Register"></th></tr> </table>
  241.  
  242.  </form>
  243.  
  244.  
  245.  <?php
  246.  
  247.  }
  248.  ?>
  249.  
  250. <br>
  251. <br>
  252. <br>
  253. <br>
  254.  
  255.  
  256.  
  257. <h2></h2>
  258.  
  259. <br>
  260. <br>
  261. <br>
  262. <br>
  263.  
  264. <h2></h2>
  265.  
  266. <br>
  267. <br>
  268. <br>
  269. <br>
  270.  
  271. </td>
  272.  
  273. <!-- ende inhalt-->
  274.  
  275. </tr>
  276. <tr>
  277. <td colspan="2" id="fussb"  >
  278.  
  279. <span style="background-color:#2F2F2F;padding:4px;border:solid 1px #343434;color:black"> || </span></td>
  280. </tr>
  281. </table>
  282.  
  283. <td class="re">&nbsp;</td><!-- aussentab-->
  284. </tr>
  285. </table>
  286.  
  287.  
  288.  
  289.  
  290. </body>
  291. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement