Jump to content

Form not submitting


Far Cry

Recommended Posts

I have this HTML form that isn't doing anything when the submit button pressed, I am using PHP to validate it. I know I am missing something, can you help me? :/ Thanks in advance!

<?php require("styles/top.php");?>
<div id="head_reg">
<div id="head_cen_reg">
  <div id="head_sup_reg" class="head_height_reg">
   <p class="search">
    <label>SEARCH</label>
    <input name="search" type="text" class="txt" />
    <input name="search-btn" type="submit" class="btn" value="SEARCH" />
   </p>
    <h1 class="logo"></h1>
   <?php require("scripts/links.php"); ?>
    </div>
    </div>
    </div>
<div id="content">
<br />
<div id="register_form">
<form action="register.php" method="post" enctype="multipart/form-data">
<center>
<table>
   <tr>
     <td>Desired Username </td>
     <td><input type="text" name="username" class="textbox" /></td>
   </tr>
   <tr>
     <td>E-Mail </td>
     <td><input type="text" name="email" class="textbox" /></td>
   </tr>
   <tr>
     <td>Password </td>
     <td><input type="text" name="pass" class="textbox" /></td>
   </tr>
   <tr>
     <td>Confirm Password </td>
     <td><input type="text" name="repass" class="textbox" /></td>
   </tr>
   <tr>
     <td><p class="register">
    <input name="reg-btn" type="submit" class="btn" value="REGISTER" />
   </p></td>
   </tr>
</table>
</center>
</form>
</div>
<center><a href="#" id="showreg">Why register? Click here</a></center>
<div id="content_cen">
  <div id="content_sup">
   <div id="welcom_pan">
   <h3><span>Why</span> Register?</h3>
   <p>Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Nulla vitae diam magna, eget fringilla tellus. Curabitur est velit, suscipit eu faucibus eget, aliquam ac enim. per inceptos himenaeos. Nulla vitae diam magna, eget fringilla tellus.</p>
   </div>
  </div>
</div>
</div>
<div id="foot">
<div id="foot_cen">
<ul>
    
   </ul>
    <p></p>
</div>
</div>
<?php
if(isset($_POST['reg_btn'])){
$username = $_POST['username'];
$email = $_POST['email'];
$password = $_POST['pass'];
$repassword = $_POST['repass'];
if ($username && $password && $repassword && $email){

  if ($password == $repassword){

			if (strstr($email, "@") && strstr($email, ".") && (strlen($email) >= 6)){


				$query = mysql_query("SELECT * FROM users WHERE username='$username'");
				$numrows = mysql_num_rows($query);
				if ($numrows == 0){

					$query = mysql_query("SELECT * FROM users WHERE email='$email'");
					$numrows = mysql_num_rows($query);
					if ($numrows == 0){



					    

						$pass = md5(md5($password));
						$ip = $_SERVER['REMOTE_ADDR'];
						$date = date("F,d,Y:g:i:s A");

						mysql_query("INSERT INTO users VALUES ('', '$username', '$pass', '$email','Member', '$date', '', '$ip', '0')");


          
		   }
	    else
		   echo"That email is already in use!";
		   }
		     else 
			    echo"That username is already taken!";
                    }
                      else
                          echo"That email is too short!";
                        
                           }
                             else
                                 echo"Those passwords do not match!";	
                                 }
							 else
							    echo"<script type='text/javascript'>alert('You did not fill out the entire form!')</script>";
                                    }
						       
                                
                                         
                             
                                             										  
?>

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.