SHARE
TWEET

Untitled

joyfriend Nov 19th, 2019 148 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. $name = $email = $gender = $major = $years = $vip = "";
  3.  
  4. if(isset($_REQUEST["submit"])) {
  5.     $name = $_REQUEST["name"];
  6.     $name = filter_var($name, FILTER_SANITIZE_STRING);
  7.        
  8.     $email = $_REQUEST["email"];
  9.     $email = filter_var($email, FILTER_VALIDATE_EMAIL);
  10.    
  11.     $gender = $_REQUEST["gender"];
  12.     $major = $_REQUEST["major"];
  13.     $fee = $_REQUEST["fee"];
  14.    
  15.     $years = $_REQUEST["years"];
  16.     $years = filter_var($years, FILTER_VALIDATE_INT);
  17.            
  18.     $vip = $_REQUEST["vip"];
  19.    
  20.     if (!empty($name) && !empty($email)) {
  21.         echo "<b>Thank you for your registration. Here is your information we collected:</b><br>";
  22.         echo "Your Name: ".$name."<br>";
  23.         echo "Your Email: ".$email."<br>";
  24.         echo "Your Gender: ".$gender."<br>";
  25.         echo "Your Major: ".$major."<br>";
  26.         echo "<hr>";
  27.        
  28.         if ($vip == "VIP")
  29.             $fee = 200;
  30.         else
  31.             $fee = 100;
  32.        
  33.         if ($years > 3)
  34.             $fee = $fee - (0.30*$fee);
  35.            
  36.         echo "Your annual membership fee is: $".number_format((float)$fee, 2, '.', '');
  37.     } else if ($years < 0) {
  38.         echo "Age can't be negative";
  39.     } else {
  40.         echo "Please fill in your name or email correctly.";
  41.     }
  42. }
  43. ?>
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