mothh9

Untitled

May 20th, 2014
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.55 KB | None | 0 0
  1. <div class="font3">Add</div>
  2. You can add a casino here:
  3.         <form method="post">
  4.             <p>Your name:</p>
  5.             <input name="name" type="text" size="25" required />
  6.             <p>Your email address:</p>
  7.             <input name="email" type="email" size="25" required />
  8.             <p>Name of the casino:</p>
  9.             <input name="casino" type="text" size="25" required />
  10.             <p>URL of the casino:</p>
  11.             <input name="url" type="url" size="25" required />
  12.             <p>Logo of casino:<sup>Image must be on your own host</sup></p>
  13.             <input name="image" type="text" size="25" />
  14.             <p>Description of the casino:</p>
  15.             <textarea name="description" cols="50" rows="5" wrap="virtual" maxlength="1000"></textarea>
  16.             <input type="submit" value="Send" />            
  17.         </form>
  18. <?php
  19. if($_SERVER['REQUEST_METHOD'] == 'POST'){
  20.     $name = $_POST['name'];
  21.     $username = $_SESSION['user_name'];
  22.     $email = $_POST['email'];
  23.     $casino = $_POST['casino'];
  24.     $url = $_POST['url'];
  25.     $image = $_POST['image'];
  26.     $description = $_POST['description'];
  27.     $code = rand(1000000000, 9999999999);
  28.    
  29.     if(preg_match('|^http(s)?://[a-z0-9-]+(.[a-z0-9-]+)*(:[0-9]+)?(/.*)?$|i', $url) OR preg_match("/^[A-Za-z0-9_- ]+$/", $name) OR preg_match("/^[A-Za-z0-9_- ]+$/", $casino) OR preg_match("/^[A-Za-z0-9_- ]+$/", $image) OR preg_match("/^[A-Za-z0-9_- ]+$/", $description)){
  30.         echo"Success!";
  31.                         }
  32.         else{
  33.             echo'No success!';
  34.     }
  35.     }
  36.     }
Advertisement
Add Comment
Please, Sign In to add comment