Advertisement
Guest User

register.php

a guest
Jun 18th, 2018
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.24 KB | None | 0 0
  1. <?php include("includes/header.php"); ?>
  2. <?php
  3.  
  4. if($_COOKIE['enter'] != "")
  5. {
  6.     header("Location: intropage.php");
  7. }
  8.  
  9. if(isset($_POST["register"])){
  10.    
  11. $CONNECT = mysqli_connect('localhost', 'litcoine_Trollbump', '4994797712alex', 'litcoine_project');
  12.   if (!$CONNECT) {
  13.     die('Ошибка соединения: ' . mysql_error());
  14.   }
  15.   echo("Успешно соединились");
  16.  
  17. if(!empty($_POST['address']) && !empty($_POST['full_name']) && !empty($_POST['username']) && !empty($_POST['password'])) {
  18.     $address=$_POST['address'];
  19.     $full_name=$_POST['full_name'];
  20.     $username=$_POST['username'];
  21.     $password=md5(md5(md5(md5(md5($_POST['password'])))));
  22.    
  23.     //$CONNECT->query("SELECT * FROM users WHERE login='$username'");
  24.     //$row = $result_set->fetch_assoc();
  25.    
  26.  
  27.     $CONNECT->query("INSERT INTO users VALUES('$username', '$password', '$address', '$full_name', '0')");
  28.  
  29.  
  30.     $message = "Account Successfully Created";
  31.     //else
  32.     //{
  33.      //$message = "Failed to insert data information!";
  34.     //}
  35.  
  36.     }
  37.     else
  38.     {
  39.      $message = "All fields are required!";
  40.     }
  41. }
  42. ?>
  43.  
  44.  
  45. <?php if (!empty($message)) {echo "<p class=\"error\">" . "MESSAGE: ". $message . "</p>";} ?>
  46.  
  47. <div class="container mregister">
  48.             <div id="login">
  49.     <h1>REGISTER</h1>
  50. <form name="registerform" id="registerform" action="register.php" method="post">
  51.     <p>
  52.         <label for="user_login">MetaMask address<br />
  53.         <input type="text" name="address" id="address" class="input" size="32" value=""  /></label>
  54.     </p>
  55.    
  56.    
  57.     <p>
  58.         <label for="user_pass">Full Name<br />
  59.         <input type="text" name="full_name" id="full_name" class="input" value="" size="32" /></label>
  60.     </p>
  61.    
  62.     <p>
  63.         <label for="user_pass">Username<br />
  64.         <input type="text" name="username" id="username" class="input" value="" size="20" /></label>
  65.     </p>
  66.    
  67.     <p>
  68.         <label for="user_pass">Password<br />
  69.         <input type="password" name="password" id="password" class="input" value="" size="32" /></label>
  70.     </p>   
  71.    
  72.  
  73.         <p class="submit">
  74.         <input type="submit" name="register" id="register" class="button" value="Register" />
  75.     </p>
  76.    
  77.     <p class="regtext">Already have an account? <a href="login.php" >Login Here</a>!</p>
  78. </form>
  79.    
  80.     </div>
  81.     </div>
  82.    
  83.    
  84.    
  85.     <?php include("includes/footer.php"); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement