Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $servername = "ei";
- $username = "root";
- $password = "fatti i cazzi tuoi";
- try {
- $conn = new PDO("mysql:host=$servername;dbname=recoins", $username, $password);
- $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
- }
- catch(PDOException $e)
- {
- echo "Fallito e merda bamboons: " . $e->getMessage();
- }
- if(isset($_POST['btn-signup'])) {
- $errMsg = '';
- $fullname = $_POST['name'];
- $email = $_POST['email'];
- $password = $_POST['pass'];
- $coins = 50;
- $rank = 1;
- if($fullname == '')
- $errMsg = 'Nome mancante';
- if($email == '')
- $errMsg = 'email mancante';
- if($password == '')
- $errMsg = 'Password mancante';
- if($errMsg == ''){
- try {
- $stmt = $connect->prepare('INSERT INTO pdo (userName, userPass, userCoins, userEmail, userRank) VALUES (:fullname, :password, :coins, :email, :rank)');
- $stmt->execute(array(
- ':fullname' => $fullname,
- ':email' => $email,
- ':password' => $password,
- ':coins' => $coins,
- ':rank' => $rank
- ));
- header('Location: register.php?action=joined');
- exit;
- }
- catch(PDOException $e) {
- echo $e->getMessage();
- }
- }
- }
- if(isset($_GET['action']) && $_GET['action'] == 'joined') {
- $errMsg = 'Hai finito! Registrazione avvenuta';
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement