Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if($_SERVER["REQUEST_METHOD"] == "POST") {
- // username and password sent from form
- if(isset($_POST['okbutton'])){
- if( isset($_POST['clientuser'], $_POST['clientpass']) ) {
- $clientuser = $_POST['clientuser'];
- $clientpass = $_POST['clientpass'];
- $_SESSION['cuser'] = $clientuser;
- $_SESSION['cpass'] = $clientpass;
- header('Location: trialaccount.php');
- die();
- }
- }
- }
- if(isset($_SESSION['cuser'])){
- $stmt = $conn->prepare("SELECT user_id FROM user WHERE user_id=:username");
- $stmt->bindParam(':username', $_SESSION['cuser']);
- $stmt->execute();
- $checkdup = $stmt->rowCount();
- if($checkdup == 0){
- $stmt = $conn->prepare("INSERT INTO user (user_id, user_pass, user_online, user_enable, user_start_date, user_end_date, reseller, type) VALUES (:clientuser, :clientpass,0, 1, now(), now() + interval 4 hour, :panelUSER, 'Trial')");
- $stmt->bindParam(':clientuser', $_SESSION['cuser']);
- $stmt->bindParam(':clientpass', $_SESSION['cpass']);
- $stmt->bindParam(':panelUSER', $username);
- $stmt->execute();
- $success = "Trial Account Created Successfully!";
- }
- else{
- $error = "Username '" . $_SESSION['cuser'] . "' is already taken. Try to input unique username." ;
- }
- }
- catch(PDOException $e)
- {
- echo "Error: Database Error";
- }
- <?php if(isset($success)){ echo $success; } ?>
Add Comment
Please, Sign In to add comment