Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include "konekcija.php";
- $username = @$_POST["username"];
- $password = @$_POST["password"];
- $email = @$_POST["email"];
- $repassword = @$_POST["repassword"];
- $reemail = @$_POST["reemail"];
- $date = date("Y-m-d");
- if(isset($_POST["reggumb"]))
- {
- $check = mysqli_query($conn,"SELECT * FROM korisnici WHERE username ='".$username."'");
- $numrows = mysqli_num_rows($check);
- if($numrows == 0)
- {
- $ins = mysqli_query($conn, "INSERT INTO korisnici (id, username, password, email, date, maincategories, subcategories,active) VALUES ('', '".$username."' , '".$password."' , '".$email."', '".$date."','".$maincategories."','".$subcategories."','".$active."' ) ;");
- if($ins)
- echo "eeeeee";
- }
- $code = rand(10000, 1000000);
- $to = $email;
- $subject = "Activate your account";
- $headers = "From: daxpodovi@yahoo.com";
- $body = "
- Hello $username
- activate your account, click on link
- http://localhost/BadBlueBoys/activate.php?code=$code&username=$username
- ";
- mysqli_query($conn,"UPDATE korisnici SET random='$code' WHERE username='".$username."'");
- mail($to,$subject,$body,$headers);
- mysqli_query($connection,"UPDATE korisnici SET active='1' WHERE random='$code'");
- echo"check email for activate";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement