Guest User

Untitled

a guest
Feb 18th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 9.93 KB | None | 0 0
  1.  
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  5. <title>Lionface</title>
  6. </head>
  7.    
  8. <style>
  9.  
  10. body { font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif; letter-spacing: 1.05pt; font-size: 13px; color: #000;
  11.         margin: 0px; background-color: #FFF; }
  12.        
  13. a:link, a:active, a:visited { text-decoration: none; color: #36A; }
  14. a:hover { color: #47C; }
  15.  
  16. a img, a:active img, a:visted img, a:hover img { border: 0px; border-width: 0 0 0 0; }
  17.  
  18. a.su:link, a.su:active, a.su:visited { color: #DFDFE7; padding: 10px; font-size: 14px; border: 1px solid #DFDFE7; position: relative; top: 25px; }
  19. a.su:hover { color: #FFF; border-color: #FFF; }
  20.  
  21. .sib { text-align: right; padding: 6px; color: #555; border: 1px solid #BBB; position: relative; left: 5px; top: -1px; }
  22. a.si:link, a.si:active, a.si:visited { text-decoration: none; color: #777; border: 1px solid #BBB; border-width: 1px 0 1px 1px;
  23.     position: relative; left: 12px; display: inline-block; background-color: #FFF; padding-left: 5px; padding-right: 10px; padding-top: 4px; padding-bottom: 3px; }
  24. a.si:hover { color: #333; text-decoration: none; }
  25.  
  26. .uts { display: block; display: inline; padding: 10px; background-color: #DFDFE7; color: #555; margin: 2px; }
  27. a.uts:link, a.uts:active, a.uts:visited { display: block; display: inline; padding: 10px; background-color: #FFF; margin: 2px; }
  28. a.uts:hover { background-color: #EEE; color: #36A; }
  29. </style>
  30.  
  31. <body>
  32.  
  33.  
  34. <?php
  35.  
  36. if (isset ($_POST['signup'])){
  37.  
  38.      $errorMsg='';
  39.      $fullname=$_POST['fullname'];
  40.      $email1 = $_POST['email1'];
  41.      $email2 = $_POST['email2'];
  42.      $pass1 = $_POST['pass1'];
  43.      $pass2 = $_POST['pass2'];
  44.      $username = $_POST['username'];
  45.      
  46.  
  47.      $email1 = stripslashes($email1);
  48.      $pass1 = stripslashes($pass1);
  49.      $fullname = stripslashes($fullname);
  50.      $email2 = stripslashes($email2);
  51.      $pass2 = stripslashes($pass2);  
  52.      $fullname = strip_tags($fullname);
  53.      $email1 = strip_tags($email1);
  54.      $pass1 = strip_tags($pass1);
  55.      $email2 = strip_tags($email2);
  56.      $pass2 = strip_tags($pass2);
  57.      
  58.      
  59.       // Connect to database
  60.      include_once "scripts/connect_to_mysql.php";
  61.      $emailCHecker = mysql_real_escape_string($email1);
  62.      $sql_uname_check = mysql_query("SELECT username FROM users WHERE username='$username'");
  63.      $uname_check = mysql_num_rows($sql_uname_check);
  64.      // Database duplicate e-mail check setup for use below in the error handling if else conditionals
  65.      $sql_email_check = mysql_query("SELECT email FROM users WHERE email='$emailCHecker'");
  66.      $email_check = mysql_num_rows($sql_email_check);
  67.  
  68.      // Error handling for missing data
  69.      if ((!$fullname) || (!$username) || (!$email1) || (!$email2) || (!$pass1) || (!$pass2)) {
  70.  
  71.      $errorMsg = 'All fields have to be filled <br /><br />';
  72.  
  73.     }
  74.        
  75.    
  76.      
  77.     if(!$fullname)
  78.     {
  79.         $errorMsg.='Please insert your full name<br />';
  80.     }
  81.  
  82.    
  83.      if(!$pass1 || !$pass2)
  84.     {
  85.         $errorMsg.='Please insert and confirm your passwords<br />';
  86.     }
  87.      if(!$email1 || !$email2)
  88.     {
  89.         $errorMsg.='Please insert and confirm your e-mails<br />';
  90.     }
  91.    
  92.     if(!$username)
  93.     {
  94.         $errorMsg.='Please insert your username<br />';
  95.     }
  96.     if (preg_match("/^[a-zA-Z'-]+\s[a-zA-Z'\- ]+$/",$fullname )){
  97.    
  98.     $fullname=preg_replace('/\s{2,}/','',$fullname);   
  99.    
  100.     }
  101.     else{
  102.    
  103.     $errorMsg.='Please insert your full name<br />';
  104.    
  105.     }
  106.    
  107.    
  108.     if($pass1!=$pass2){
  109.        $errorMsg .= 'Your Password fields below do not match<br />';
  110.      }
  111.      
  112.      
  113.  
  114.     if (!preg_match("/^[^0-9][A-z0-9_]+([.][A-z0-9_]+)*[@][A-z0-9_]+([.][A-z0-9_]+)*[.][A-z]{2,4}$/", $email1))
  115.         {
  116.             if($email1 || $email2 != '')
  117.                 $errorMsg.='Email address is not valid.<br />';
  118.         }
  119.      
  120.    
  121.      if ($uname_check > 0){
  122.               $errorMsg = "Your User Name is already in use inside of our system. Please try another.";
  123.      }
  124.      
  125.      if ($email_check > 0){
  126.               $errorMsg = "Your Email address is already in use inside of our system. Please use another.";
  127.      }
  128.      
  129.     if(strlen($pass1) < 7){
  130.        
  131.        $errorMsg .= 'Your Password has to be atleast 7 characters long<br />';
  132.      }
  133.    
  134.    
  135.      else if($email1!=$email2){
  136.            
  137.             $errorMsg .= 'Your Email fields below do not match<br />';
  138.      }
  139.      if(strlen($username)<3){
  140.             $errorMsg .= 'Username is too short, minimum 4 characters<br />';
  141.      }
  142.      
  143.     if (!preg_match("/^[A-Za-z]{4,19}$/", $username))
  144.     {
  145.                 $errorMsg.='Username is not valid.<br />';
  146.     }
  147.      
  148.      if(strlen($username)>20){
  149.             $errorMsg .= 'Username is too long, has be less then 20 characters<br />';
  150.      }
  151.    
  152.    
  153.         if ($errorMsg!=''){
  154.      
  155.                 echo $errorMsg;
  156.        
  157.         }
  158.        
  159.         else{
  160.        
  161.         $email1 = mysql_real_escape_string($email1);
  162.         $pass1 = mysql_real_escape_string($pass1);
  163.         $username = mysql_real_escape_string($username);
  164.         $password = md5($pass1);
  165.         $ipaddress = getenv('REMOTE_ADDR');
  166.        
  167.        
  168.          $sql = mysql_query("INSERT INTO users (username, fullname, email, password, ipadress, sign_up_date)
  169.     VALUES('$username','$fullname','$email1','$password', '$ipaddress', now())")  
  170.      or die (mysql_error());
  171.  
  172.      
  173.      // Create directory(folder) to hold each user's files(pics, MP3s, etc.)       
  174.      mkdir("members/$username", 0755); 
  175.  
  176.        
  177.        
  178.         }
  179.        
  180.    
  181.      }
  182.      
  183.  
  184.      echo $fullname;
  185.      
  186.    
  187.      
  188.    
  189.  
  190.  
  191. ?>
  192.  
  193.  
  194. <div align="center">
  195. <div style="width: 900px; height: 100px; padding-top: 25px;">
  196.     <table border="0" cellspacing="10" cellpadding="0" style="color: #999; font-size: 12px;">
  197.       <tr>
  198.         <td>Email <input name="" type="text" class="sib" size="30"></td>
  199.         <td><div style="padding-left: 20px;">Password <input name="" type="password" class="sib" size="25"></div></td>
  200.         <td><a href="user/feed.html" class="si" style="padding-left: 10px; border-width: 1px 1px 1px 1px; background-color: #F7F7F7;">Sign In</a></td>
  201.       </tr>
  202.       <tr>
  203.         <td align="right"><input name="" type="checkbox" value=""> Stay logged in.</td>
  204.         <td align="right"><a href="#">Forgot your password?</a></td>
  205.         <td>&nbsp;</td>
  206.       </tr>
  207.       <tr>
  208.         <td align="right">&nbsp;</td>
  209.         <td align="right">&nbsp;</td>
  210.         <td>&nbsp;</td>
  211.       </tr>
  212.       <tr>
  213.         <td align="right">&nbsp;</td>
  214.         <td align="right">&nbsp;</td>
  215.         <td>&nbsp;</td>
  216.       </tr>
  217.       <tr>
  218.         <td align="right">&nbsp;</td>
  219.         <td align="right">&nbsp;</td>
  220.         <td>&nbsp;</td>
  221.       </tr>
  222.     </table>
  223. </div>
  224. </div>
  225.  
  226. <div style="position: relative; width: 100%; height: 350px; background-color: #DFDFE7; text-align: center;">
  227.                     <div style="position: absolute; top: 20px; height: 310px; width: 100%;  background-image: url(images/centerBG.jpg);"></div>
  228.                     <div style="position: absolute; top: 20px; height: 310px; width: 100%;  background-image: url(images/center.png);"></div>
  229.  
  230. <div align="center">
  231.  
  232.     <div style="position: relative; top: 25px; width: 900px; height: 310px;">
  233.    
  234. <table width="100%" height="100%" border="0" style="color: #FFF; text-align: center;">
  235.   <tr>
  236.     <td width="50%"><div style="font-size: 40px; position: relative; top: -25px;">
  237.            
  238.            
  239.               <img src="images/logo.png" width="300" style="position: relative; top: 25px;" />
  240.              
  241.            
  242.             </div>
  243.  
  244.           </td>
  245.     <td width="50%"><table width="100%" border="0" cellspacing="0" cellpadding="4" style="color: #FFF; font-size: 13px;">
  246.    
  247.             <form method="POST" action="signup.php"  enctype="multipart/form-data">
  248.    
  249.       <tr>
  250.         <td align="right">Full Name:<br /><span style="font-size: 11px;">You can change this later. </span></td>
  251.         <td><input name="fullname" type="text" id="fullname" size="30" style=" border: 0px; padding: 5px;"></td>
  252.       </tr>
  253.       <tr>
  254.         <td align="right">Password:</td>
  255.         <td><input name="pass1" type="password" size="30"" style=" border: 0px; padding: 5px;"></td>
  256.       </tr>
  257.       <tr>
  258.         <td align="right">Confirm Password:</td>
  259.         <td><input name="pass2" type="password"  size="30" style=" border: 0px; padding: 5px;"></td>
  260.       </tr>
  261.       <tr>
  262.         <td align="right">Email:</td>
  263.         <td><input name="email1" type="text" size="30" style=" border: 0px; padding: 5px;" id="email1"></td>
  264.       </tr>
  265.       <tr>
  266.         <td align="right">Confirm Email:</td>
  267.         <td><input name="email2" type="text" size="30" style=" border: 0px; padding: 5px;" id="email2"></td>
  268.       </tr>
  269.       <tr>
  270.         <td align="right">Username:<br /><span style="font-size: 11px;">lionface.org/username </span></td>
  271.         <td><input name="username" type="text" size="30" style=" border: 0px; padding: 5px;" id="username"></td>
  272.       </tr>
  273.       <tr>
  274.       <td colspan="2" style="font-size: 11px; text-align: right;"><input name="" type="checkbox" value="" id="terms"> I agree to the <a href="user/footer_terms.html" target="_blank" style="color: #DDD">Terms of Service</a>.
  275.    
  276.     <input type="submit" name="signup" id="signup" value="Sign Up" />
  277.     </td>
  278.      
  279.       </tr>
  280.         </form>
  281. </table></td>
  282.   </tr>
  283. </table>
  284.            
  285.  
  286. </div></div></div>
  287.  
  288. <div align="center">
  289.  
  290.      <div style="position: relative; top: 10px; color: #999;">
  291.      <div style=" visibility: hidden;"><span class="uts">User</span><a href="#" class="uts">Public</a><a href="#" class="uts">Business</a><a href="#" class="uts">Non-Profit</a><a href="#" class="uts">School</a><a href="#" class="uts">Government</a></div><p />          
  292.        
  293.        <div style="font-size: 11px; position: relative; top: 15px;"><a href="user/schoolAll.html">Schools</a><br />
  294.         <a href="footer_about.html">About</a> | <a href="footer_feedback.html">Feedback</a> | <a href="footer_privacy.html">Privacy</a> | <a href="footer_terms.html">Terms</a><br />
  295.        
  296.         <script type="text/javascript">
  297.  
  298.     today=new Date();
  299.     y0=today.getFullYear();
  300.  
  301. </script>
  302.  
  303.   <script type="text/javascript">
  304.  
  305.     Copyright &copy;
  306.   <!--- Hide from old browsers
  307.     document.write(y0);
  308.    
  309. -->
  310. </script>
  311. Lionface </p>
  312.         </div>
  313.      </div>
  314.  
  315. </div>
  316.  
  317. </body>
  318. </html>
Add Comment
Please, Sign In to add comment