Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
- <title>Lionface</title>
- </head>
- <style>
- body { font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif; letter-spacing: 1.05pt; font-size: 13px; color: #000;
- margin: 0px; background-color: #FFF; }
- a:link, a:active, a:visited { text-decoration: none; color: #36A; }
- a:hover { color: #47C; }
- a img, a:active img, a:visted img, a:hover img { border: 0px; border-width: 0 0 0 0; }
- a.su:link, a.su:active, a.su:visited { color: #DFDFE7; padding: 10px; font-size: 14px; border: 1px solid #DFDFE7; position: relative; top: 25px; }
- a.su:hover { color: #FFF; border-color: #FFF; }
- .sib { text-align: right; padding: 6px; color: #555; border: 1px solid #BBB; position: relative; left: 5px; top: -1px; }
- a.si:link, a.si:active, a.si:visited { text-decoration: none; color: #777; border: 1px solid #BBB; border-width: 1px 0 1px 1px;
- position: relative; left: 12px; display: inline-block; background-color: #FFF; padding-left: 5px; padding-right: 10px; padding-top: 4px; padding-bottom: 3px; }
- a.si:hover { color: #333; text-decoration: none; }
- .uts { display: block; display: inline; padding: 10px; background-color: #DFDFE7; color: #555; margin: 2px; }
- a.uts:link, a.uts:active, a.uts:visited { display: block; display: inline; padding: 10px; background-color: #FFF; margin: 2px; }
- a.uts:hover { background-color: #EEE; color: #36A; }
- </style>
- <body>
- <?php
- if (isset ($_POST['signup'])){
- $errorMsg='';
- $fullname=$_POST['fullname'];
- $email1 = $_POST['email1'];
- $email2 = $_POST['email2'];
- $pass1 = $_POST['pass1'];
- $pass2 = $_POST['pass2'];
- $username = $_POST['username'];
- $email1 = stripslashes($email1);
- $pass1 = stripslashes($pass1);
- $fullname = stripslashes($fullname);
- $email2 = stripslashes($email2);
- $pass2 = stripslashes($pass2);
- $fullname = strip_tags($fullname);
- $email1 = strip_tags($email1);
- $pass1 = strip_tags($pass1);
- $email2 = strip_tags($email2);
- $pass2 = strip_tags($pass2);
- // Connect to database
- include_once "scripts/connect_to_mysql.php";
- $emailCHecker = mysql_real_escape_string($email1);
- $sql_uname_check = mysql_query("SELECT username FROM users WHERE username='$username'");
- $uname_check = mysql_num_rows($sql_uname_check);
- // Database duplicate e-mail check setup for use below in the error handling if else conditionals
- $sql_email_check = mysql_query("SELECT email FROM users WHERE email='$emailCHecker'");
- $email_check = mysql_num_rows($sql_email_check);
- // Error handling for missing data
- if ((!$fullname) || (!$username) || (!$email1) || (!$email2) || (!$pass1) || (!$pass2)) {
- $errorMsg = 'All fields have to be filled <br /><br />';
- }
- if(!$fullname)
- {
- $errorMsg.='Please insert your full name<br />';
- }
- if(!$pass1 || !$pass2)
- {
- $errorMsg.='Please insert and confirm your passwords<br />';
- }
- if(!$email1 || !$email2)
- {
- $errorMsg.='Please insert and confirm your e-mails<br />';
- }
- if(!$username)
- {
- $errorMsg.='Please insert your username<br />';
- }
- if (preg_match("/^[a-zA-Z'-]+\s[a-zA-Z'\- ]+$/",$fullname )){
- $fullname=preg_replace('/\s{2,}/','',$fullname);
- }
- else{
- $errorMsg.='Please insert your full name<br />';
- }
- if($pass1!=$pass2){
- $errorMsg .= 'Your Password fields below do not match<br />';
- }
- if (!preg_match("/^[^0-9][A-z0-9_]+([.][A-z0-9_]+)*[@][A-z0-9_]+([.][A-z0-9_]+)*[.][A-z]{2,4}$/", $email1))
- {
- if($email1 || $email2 != '')
- $errorMsg.='Email address is not valid.<br />';
- }
- if ($uname_check > 0){
- $errorMsg = "Your User Name is already in use inside of our system. Please try another.";
- }
- if ($email_check > 0){
- $errorMsg = "Your Email address is already in use inside of our system. Please use another.";
- }
- if(strlen($pass1) < 7){
- $errorMsg .= 'Your Password has to be atleast 7 characters long<br />';
- }
- else if($email1!=$email2){
- $errorMsg .= 'Your Email fields below do not match<br />';
- }
- if(strlen($username)<3){
- $errorMsg .= 'Username is too short, minimum 4 characters<br />';
- }
- if (!preg_match("/^[A-Za-z]{4,19}$/", $username))
- {
- $errorMsg.='Username is not valid.<br />';
- }
- if(strlen($username)>20){
- $errorMsg .= 'Username is too long, has be less then 20 characters<br />';
- }
- if ($errorMsg!=''){
- echo $errorMsg;
- }
- else{
- $email1 = mysql_real_escape_string($email1);
- $pass1 = mysql_real_escape_string($pass1);
- $username = mysql_real_escape_string($username);
- $password = md5($pass1);
- $ipaddress = getenv('REMOTE_ADDR');
- $sql = mysql_query("INSERT INTO users (username, fullname, email, password, ipadress, sign_up_date)
- VALUES('$username','$fullname','$email1','$password', '$ipaddress', now())")
- or die (mysql_error());
- // Create directory(folder) to hold each user's files(pics, MP3s, etc.)
- mkdir("members/$username", 0755);
- }
- }
- echo $fullname;
- ?>
- <div align="center">
- <div style="width: 900px; height: 100px; padding-top: 25px;">
- <table border="0" cellspacing="10" cellpadding="0" style="color: #999; font-size: 12px;">
- <tr>
- <td>Email <input name="" type="text" class="sib" size="30"></td>
- <td><div style="padding-left: 20px;">Password <input name="" type="password" class="sib" size="25"></div></td>
- <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>
- </tr>
- <tr>
- <td align="right"><input name="" type="checkbox" value=""> Stay logged in.</td>
- <td align="right"><a href="#">Forgot your password?</a></td>
- <td> </td>
- </tr>
- <tr>
- <td align="right"> </td>
- <td align="right"> </td>
- <td> </td>
- </tr>
- <tr>
- <td align="right"> </td>
- <td align="right"> </td>
- <td> </td>
- </tr>
- <tr>
- <td align="right"> </td>
- <td align="right"> </td>
- <td> </td>
- </tr>
- </table>
- </div>
- </div>
- <div style="position: relative; width: 100%; height: 350px; background-color: #DFDFE7; text-align: center;">
- <div style="position: absolute; top: 20px; height: 310px; width: 100%; background-image: url(images/centerBG.jpg);"></div>
- <div style="position: absolute; top: 20px; height: 310px; width: 100%; background-image: url(images/center.png);"></div>
- <div align="center">
- <div style="position: relative; top: 25px; width: 900px; height: 310px;">
- <table width="100%" height="100%" border="0" style="color: #FFF; text-align: center;">
- <tr>
- <td width="50%"><div style="font-size: 40px; position: relative; top: -25px;">
- <img src="images/logo.png" width="300" style="position: relative; top: 25px;" />
- </div>
- </td>
- <td width="50%"><table width="100%" border="0" cellspacing="0" cellpadding="4" style="color: #FFF; font-size: 13px;">
- <form method="POST" action="signup.php" enctype="multipart/form-data">
- <tr>
- <td align="right">Full Name:<br /><span style="font-size: 11px;">You can change this later. </span></td>
- <td><input name="fullname" type="text" id="fullname" size="30" style=" border: 0px; padding: 5px;"></td>
- </tr>
- <tr>
- <td align="right">Password:</td>
- <td><input name="pass1" type="password" size="30"" style=" border: 0px; padding: 5px;"></td>
- </tr>
- <tr>
- <td align="right">Confirm Password:</td>
- <td><input name="pass2" type="password" size="30" style=" border: 0px; padding: 5px;"></td>
- </tr>
- <tr>
- <td align="right">Email:</td>
- <td><input name="email1" type="text" size="30" style=" border: 0px; padding: 5px;" id="email1"></td>
- </tr>
- <tr>
- <td align="right">Confirm Email:</td>
- <td><input name="email2" type="text" size="30" style=" border: 0px; padding: 5px;" id="email2"></td>
- </tr>
- <tr>
- <td align="right">Username:<br /><span style="font-size: 11px;">lionface.org/username </span></td>
- <td><input name="username" type="text" size="30" style=" border: 0px; padding: 5px;" id="username"></td>
- </tr>
- <tr>
- <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>.
- <input type="submit" name="signup" id="signup" value="Sign Up" />
- </td>
- </tr>
- </form>
- </table></td>
- </tr>
- </table>
- </div></div></div>
- <div align="center">
- <div style="position: relative; top: 10px; color: #999;">
- <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 />
- <div style="font-size: 11px; position: relative; top: 15px;"><a href="user/schoolAll.html">Schools</a><br />
- <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 />
- <script type="text/javascript">
- today=new Date();
- y0=today.getFullYear();
- </script>
- <script type="text/javascript">
- Copyright ©
- <!--- Hide from old browsers
- document.write(y0);
- -->
- </script>
- Lionface </p>
- </div>
- </div>
- </div>
- </body>
- </html>
Add Comment
Please, Sign In to add comment