SHARE
TWEET

ttt

a guest Mar 20th, 2016 109 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. include "konekcija.php";
  3.  
  4.  
  5.  
  6. $username = @$_POST["username"];
  7. $password = @$_POST["password"];
  8. $email = @$_POST["email"];
  9. $repassword = @$_POST["repassword"];
  10. $reemail = @$_POST["reemail"];
  11. $date = date("Y-m-d");
  12.  
  13.  
  14.  
  15.  
  16. if(isset($_POST["reggumb"]))
  17. {
  18.     $check = mysqli_query($conn,"SELECT * FROM korisnici WHERE username ='".$username."'");
  19.             $numrows = mysqli_num_rows($check);
  20.             if($numrows == 0)
  21.             {
  22.                
  23.                 $ins = mysqli_query($conn, "INSERT INTO korisnici (id, username, password, email, date, maincategories, subcategories,active) VALUES ('',  '".$username."' ,  '".$password."' ,  '".$email."', '".$date."','".$maincategories."','".$subcategories."','".$active."' ) ;");
  24.                 if($ins)
  25.                    echo "eeeeee";
  26.             }
  27.            
  28.                
  29.            
  30.                
  31.            
  32.             $code = rand(10000, 1000000);
  33.            
  34.             $to = $email;
  35.             $subject = "Activate your account";
  36.             $headers = "From: daxpodovi@yahoo.com";
  37.             $body = "
  38.                
  39.             Hello $username
  40.                
  41.             activate your account, click on link
  42.            
  43.             http://localhost/BadBlueBoys/activate.php?code=$code&username=$username
  44.  
  45.              ";
  46.            
  47.             mysqli_query($conn,"UPDATE korisnici SET random='$code' WHERE username='".$username."'");
  48.            
  49.             mail($to,$subject,$body,$headers);
  50.            
  51.             mysqli_query($connection,"UPDATE korisnici SET active='1' WHERE random='$code'");
  52.            
  53.             echo"check email for activate";
  54.            
  55.  
  56.            
  57.            
  58.                    
  59.  
  60.  
  61.                    
  62.            
  63. }    
  64.    
  65.    
  66.    
  67.  
  68.  
  69.  
  70. ?>
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