Advertisement
Guest User

Untitled

a guest
May 22nd, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.29 KB | None | 0 0
  1. <html>
  2. <head>
  3. <title>GGL Duel League Registration</title>
  4. <link rel="stylesheet" type="text/css" href="GGL.css" />
  5. </head>
  6. <body>
  7. <img src="images/ggl_logo.gif" width="250" height="150" />
  8. <h1>GGL Duel League Registration</h1>
  9. <form name="register" action="" method="post" enctype="multipart/form-data">
  10. First Name: <input type="text" name="fname" /><br/>
  11. Last Name: <input type="text" name="lname" /><br/>
  12. Site Username: <input type="text" name="alias" /><br/>
  13. Site Password: <input type="password" name="password" /><br/>
  14. Quake Live Username:<input type="text" name="qlun" /><br/>
  15. <input type="hidden" name="MAX_FILE_SIZE" value="102400" />
  16. Image Profile Picture: <input type="file" name="userpic" value="Browse!" /><br/>
  17. <input type="submit" name="submit" value="Register!"/>
  18. </form>
  19. </body>
  20. </html>
  21. <?php
  22.     if (isset($_POST['submit'])) {
  23.         require_once 'constants.php';
  24.        
  25.         $target_path = "/home/a6776762/public_html/GGL/users/";
  26.         $file = basename($_FILES['userpic']['name']);
  27.         $target_path = $target_path . $file;
  28.         $tok = strtok($file, ".");
  29.         $tok = strtok(".");
  30.         if ((strtolower($tok) == "jpeg") || (strtolower($tok) == "jpg"))
  31.         {
  32.             move_uploaded_file($file, $target_path);
  33.         }
  34.         else
  35.             echo "Invalid file type! Please try again with a JPG image under 100 KB";
  36.     }
  37. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement