Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include("database.php"); //$db=new PDO...
- $fname=$_POST["fname"];
- $lname=$_POST["lname"];
- $email=$_POST["email"];
- $username=$_POST["username"];
- $password=$_POST["password"];
- $password_confirm=$_POST["password_confirm"];
- if($password!=$password_confirm) die("Passwords not identical!");
- $default_profile_picture=file_get_contents("user_default.png");
- $default_profile_picture=base64_encode($default_profile_picture);
- $stmt = $db->prepare("insert into utilizatori
- values( :id ,
- :username,
- :password,
- :lname,
- :fname,
- :email,
- :user_type,
- :description,
- :profile_pic,
- :show_profile_pic,
- :show_email,
- :is_active ,
- :data )");
- $stmt->execute(array(
- ':id' => null,
- ':username' => $username,
- ':password' => $password,
- ':lname' => $lname,
- ':fname' => $fname,
- ':email' => $email,
- ':user_type' => 'utilizator',
- ':descrption' => '',
- ':profile_pic' => $default_profile_picture,
- ':show_profile_pic' => 1,
- ':show_email' => 1,
- ':is_active' => 1,
- ':data' => date("Y-m-d")));
- die("Account created!");
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement