SHARE
TWEET

reg1

a guest Sep 15th, 2019 187 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. session_start();
  3. if(isset($_REQUEST['attempt'])) {
  4.     $servername = "localhost";
  5.     $username = "dylpio";
  6.     $password = "myazWtUPsql";
  7.     $dbname = "dylpio";
  8.  
  9. // Create connection
  10.     $conn = mysqli_connect($servername, $username, $password, $dbname);;
  11.     if (!$conn) {
  12.         die("Connection failed: " . mysqli_error($conn));
  13.     }
  14.     if(isset($_POST['login']) && isset($_POST['passwd']) && isset($_POST['email'])) {
  15.         $usrnm = $_POST['login'];
  16.         $password = $_POST['passwd'];
  17.         $email = $_POST['email'];
  18.     }else{
  19.         echo "Podaj kompletne dane do rejestracji!";
  20.     }
  21.  
  22.     $sql = "INSERT INTO loginsTB (id, login, pass, email) VALUES ('','$usrnm', '$password', '$email')";
  23.     if (mysqli_query($conn, $sql)=== TRUE) {
  24.         echo "Zostałeś pomyślnie zarejestrowany!";
  25.     } else {
  26.         echo "ERROR: " . $sql . "<br>" . $conn->error;
  27.     }
  28.     if (!isset($_SESSION["login"])) {
  29.         header("Location: registeredsite.php");
  30.     }
  31.     mysqli_close($conn);
  32. }
  33.  
  34. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top