Php register form help.

Dobby

Member
Nov 8, 2010
156
5
Im trying to make this add people to the database but i cant seem to get it to work.

Code:
<a href="#x" class="overlay" id="join_form"></a>
        <div class="popup">
            <h2>Sign Up</h2>
            <p>Please enter the details you would like to<br>
            register with here. You MUST be <br>atleast thirteen
            to register.</p><br>
            <form action="register.php" method="post">
            <div>
                <label for="email">Email</label>
                <input type="text" id="email" value="" />
            </div>
            <div>
                <label for="pass">Password</label>
                <input type="password" id="pass" value="" />
            </div>
            <div>
                <label for="firstname">First name</label>
                <input type="text" id="firstname" value="" />
            </div>
            <div>
                <label for="lastname">Last name</label>
                <input type="text" id="lastname" value="" />
            </div>
            <div>
            <label for="age">Sex</label>
            <input type="radio" name="sex" value="male">Male
            <input type="radio" name="sex" value="female">Female
            </div>
            </form>

I have a had a go at adding the PHP to it but nothing seems to work. Can someone help?
 

Dobby

Member
Nov 8, 2010
156
5
Okay here goes :D

PHP:
<body>
 
 
 
<div class="header">
<div class="wrapper">
<div class="Logo"></div>
<div class="headernav"><font color="white"><b>
Please login or register to enter the Dobby's Network website.</b></font>
</div>
 
        </div>
        </div>
       
       
 
 
               
               
                <div id="wrapper_content">
                <div class="left">
                <div class="box">
                <center><br>
               
                <a href="#login_form" id="login_pop">
                <img src="images/login.png"/></a>
                <br><br>
                </center>
                </div>
                </div>
           
                    <div class="right">
                        <div class="box">
                        <center><br>
           
           
                <a href="#join_form" id="join_pop">
                <img src="images/register.png"/></a>
           
                <br><br>
                </center>
                </div>
                </div>
            <br><br><center>
                <font color="red"><b><p>Warning: This is just a DEMO. Nothing actually works here at the moment<p></b></font>
                <center>
               
                <!-- Popups -->
 
 
 
 
 
 
                <a href="#x" class="overlay" id="login_form"></a>
                <div class="popup">
               
            <h2>Welcome Guest!</h2>
            <p>Please login to gain access to the full website.</p><br>
            <div>
                <label for="login">Email</label>
                <input type="text" id="login" value="" />
            </div>
            <div>
                <label for="password">Password</label>
                <input type="password" id="password" value="" />
            </div>
            <center>
            <input type="button" name="login" value="Log In" />
           
            </center>
 
            <a class="close" href="#close"></a>
        </div>
 
     
 
 
 
 
 
 
      <!-- popup form #2 -->
 
       
        <a href="#x" class="overlay" id="join_form"></a>
        <div class="popup">
       
       
       
        <?
 
include_once"config.php";
if (isset($_POST['register'])) {
    $email = $_POST['email'];
    $password = $_POST['password'];
    $firstname = $_POST['firstname'];
    $lastname = $_POST['lastname'];
    $memip = $_SERVER['REMOTE_ADDR'];
    $date = date("d-m-Y");
    if (empty($email) OR empty($password)) {
        $final_report.= "Please complete the form below..";
    }
        else {
            $check_members = mysql_query("SELECT * FROM `members` WHERE `email` = '$email'") or die(mysql_error());
            if (mysql_num_rows($check_members) != 0) {
                $final_report.="The username is already in use!";
            } else if (strlen($password) <= 6 || strlen($password) >= 12) {
                    $final_report.="Your password must be between 6 and 12 digits and characters..";
                } else if (!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email)) {
                        $final_report.="Your email address was not valid..";
                    } else {
                        $create_member = mysql_query("INSERT INTO `members` (`id`,`email`, `password`, `firstname`, `lastname`, `ip`, `date`)
VALUES('','$email','$password','$firstname','$lastname','$memip','$date')");
                        $final_report.="Thank you for registering, you may login.";
                    }
                }
            }
 
echo "I didn't set the register POST.";
?>
       
       
       
       
       
       
       
       
       
       
       
            <h2>Sign Up</h2>
            <p>Please enter the details you would like to<br>
            register with here. You MUST be <br>atleast thirteen
            to register.</p><br>
            <form action="" method="post">
            <div>
                <label for="email">Email</label>
                <input type="text" id="email" value="" />
            </div>
            <div>
                <label for="pass">Password</label>
                <input type="password" id="pass" value="" />
            </div>
            <div>
                <label for="firstname">First name</label>
                <input type="text" id="firstname" value="" />
            </div>
            <div>
                <label for="lastname">Last name</label>
                <input type="text" id="lastname" value="" />
            </div>
            <div>
            <label for="sex">Sex</label>
            <input type="radio" name="sex" value="male">Male
            <input type="radio" name="sex" value="female">Female
            </div>
            </form>
           
               
           
           
           
           
           
           
            <center>
   
            <input type="button" id="register" value="Sign Up" />&nbsp;&nbsp;&nbsp;or&nbsp;&nbsp;&nbsp;<a href="#login_form" id="login_pop">Log In</a>
 
            <a class="close" href="#close"></a>
            </center>
        </div>
               
               
            </div>
 
        </div>

Yea. im confused...
 

Tanis

New Member
Jan 5, 2011
22
6
"<input type="button" id="register" value="Sign Up" />" is not submitting the form. It's a "button" element outside the form.

HTML:
<body>
 
 
 
<div class="header">
<div class="wrapper">
<div class="Logo"></div>
<div class="headernav"><font color="white"><b>
Please login or register to enter the Dobby's Network website.</b></font>
</div>
 
        </div>
        </div>
     
     
 
 
             
             
                <div id="wrapper_content">
                <div class="left">
                <div class="box">
                <center><br>
             
                <a href="#login_form" id="login_pop">
                <img src="images/login.png"/></a>
                <br><br>
                </center>
                </div>
                </div>
         
                    <div class="right">
                        <div class="box">
                        <center><br>
         
         
                <a href="#join_form" id="join_pop">
                <img src="images/register.png"/></a>
         
                <br><br>
                </center>
                </div>
                </div>
            <br><br><center>
                <font color="red"><b><p>Warning: This is just a DEMO. Nothing actually works here at the moment<p></b></font>
                <center>
             
                <!-- Popups -->
 
 
 
 
 
 
                <a href="#x" class="overlay" id="login_form"></a>
                <div class="popup">
             
            <h2>Welcome Guest!</h2>
            <p>Please login to gain access to the full website.</p><br>
            <div>
                <label for="login">Email</label>
                <input type="text" id="login" value="" />
            </div>
            <div>
                <label for="password">Password</label>
                <input type="password" id="password" value="" />
            </div>
            <center>
            <input type="button" name="login" value="Log In" />
         
            </center>
 
            <a class="close" href="#close"></a>
        </div>
 
   
 
 
 
 
 
 
      <!-- popup form #2 -->
 
     
        <a href="#x" class="overlay" id="join_form"></a>
        <div class="popup">
     
     
     
        <?
 
include_once"config.php";
if (isset($_POST['register'])) {
    $email = $_POST['email'];
    $password = $_POST['password'];
    $firstname = $_POST['firstname'];
    $lastname = $_POST['lastname'];
    $memip = $_SERVER['REMOTE_ADDR'];
    $date = date("d-m-Y");
    if (empty($email) OR empty($password)) {
        $final_report.= "Please complete the form below..";
    }
        else {
            $check_members = mysql_query("SELECT * FROM `members` WHERE `email` = '$email'") or die(mysql_error());
            if (mysql_num_rows($check_members) != 0) {
                $final_report.="The username is already in use!";
            } else if (strlen($password) <= 6 || strlen($password) >= 12) {
                    $final_report.="Your password must be between 6 and 12 digits and characters..";
                } else if (!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email)) {
                        $final_report.="Your email address was not valid..";
                    } else {
                        $create_member = mysql_query("INSERT INTO `members` (`id`,`email`, `password`, `firstname`, `lastname`, `ip`, `date`)
VALUES('','$email','$password','$firstname','$lastname','$memip','$date')");
                        $final_report.="Thank you for registering, you may login.";
                    }
                }
            }
 
echo "I didn't set the register POST.";
?>
     
     
     
     
     
     
     
     
     
     
     
            <h2>Sign Up</h2>
            <p>Please enter the details you would like to<br>
            register with here. You MUST be <br>atleast thirteen
            to register.</p><br>
            <form action="" method="post">
            <div>
                <label for="email">Email</label>
                <input type="text" id="email" value="" />
            </div>
            <div>
                <label for="pass">Password</label>
                <input type="password" id="pass" value="" />
            </div>
            <div>
                <label for="firstname">First name</label>
                <input type="text" id="firstname" value="" />
            </div>
            <div>
                <label for="lastname">Last name</label>
                <input type="text" id="lastname" value="" />
            </div>
            <div>
            <label for="sex">Sex</label>
            <input type="radio" name="sex" value="male">Male
            <input type="radio" name="sex" value="female">Female
            </div>
 
            <input type="submit" id="register" value="Sign Up" />&nbsp;&nbsp;&nbsp;or&nbsp;&nbsp;&nbsp;<a href="#login_form" id="login_pop">Log In</a>
 
            </form>
         
             
         
         
         
         
         
         
            <center>
   
            <a class="close" href="#close"></a>
            </center>
        </div>
             
             
            </div>
 
        </div>

Try that maybe?
 

TesoMayn

Boredom, it vexes me.
Oct 30, 2011
1,482
1,482
Set the <? to <?php incase your server doesn't allow short tags.

Change
PHP:
$password = $_POST['password'];
to
PHP:
$password = $_POST['pass'];

And then let me know if it works.
 

Weasel

👄 I'd intercept me
Nov 25, 2011
4,135
2,461
"<input type="button" id="register" value="Sign Up" />" is not submitting the form. It's a "button" element outside the form.

HTML:
<body>
 
 
 
<div class="header">
<div class="wrapper">
<div class="Logo"></div>
<div class="headernav"><font color="white"><b>
Please login or register to enter the Dobby's Network website.</b></font>
</div>
 
        </div>
        </div>
 
 
 
 
         
         
                <div id="wrapper_content">
                <div class="left">
                <div class="box">
                <center><br>
         
                <a href="#login_form" id="login_pop">
                <img src="images/login.png"/></a>
                <br><br>
                </center>
                </div>
                </div>
     
                    <div class="right">
                        <div class="box">
                        <center><br>
     
     
                <a href="#join_form" id="join_pop">
                <img src="images/register.png"/></a>
     
                <br><br>
                </center>
                </div>
                </div>
            <br><br><center>
                <font color="red"><b><p>Warning: This is just a DEMO. Nothing actually works here at the moment<p></b></font>
                <center>
         
                <!-- Popups -->
 
 
 
 
 
 
                <a href="#x" class="overlay" id="login_form"></a>
                <div class="popup">
         
            <h2>Welcome Guest!</h2>
            <p>Please login to gain access to the full website.</p><br>
            <div>
                <label for="login">Email</label>
                <input type="text" id="login" value="" />
            </div>
            <div>
                <label for="password">Password</label>
                <input type="password" id="password" value="" />
            </div>
            <center>
            <input type="button" name="login" value="Log In" />
     
            </center>
 
            <a class="close" href="#close"></a>
        </div>
 
 
 
 
 
 
 
 
      <!-- popup form #2 -->
 
 
        <a href="#x" class="overlay" id="join_form"></a>
        <div class="popup">
 
 
 
        <?
 
include_once"config.php";
if (isset($_POST['register'])) {
    $email = $_POST['email'];
    $password = $_POST['password'];
    $firstname = $_POST['firstname'];
    $lastname = $_POST['lastname'];
    $memip = $_SERVER['REMOTE_ADDR'];
    $date = date("d-m-Y");
    if (empty($email) OR empty($password)) {
        $final_report.= "Please complete the form below..";
    }
        else {
            $check_members = mysql_query("SELECT * FROM `members` WHERE `email` = '$email'") or die(mysql_error());
            if (mysql_num_rows($check_members) != 0) {
                $final_report.="The username is already in use!";
            } else if (strlen($password) <= 6 || strlen($password) >= 12) {
                    $final_report.="Your password must be between 6 and 12 digits and characters..";
                } else if (!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email)) {
                        $final_report.="Your email address was not valid..";
                    } else {
                        $create_member = mysql_query("INSERT INTO `members` (`id`,`email`, `password`, `firstname`, `lastname`, `ip`, `date`)
VALUES('','$email','$password','$firstname','$lastname','$memip','$date')");
                        $final_report.="Thank you for registering, you may login.";
                    }
                }
            }
 
echo "I didn't set the register POST.";
?>
 
 
 
 
 
 
 
 
 
 
 
            <h2>Sign Up</h2>
            <p>Please enter the details you would like to<br>
            register with here. You MUST be <br>atleast thirteen
            to register.</p><br>
            <form action="" method="post">
            <div>
                <label for="email">Email</label>
                <input type="text" id="email" value="" />
            </div>
            <div>
                <label for="pass">Password</label>
                <input type="password" id="pass" value="" />
            </div>
            <div>
                <label for="firstname">First name</label>
                <input type="text" id="firstname" value="" />
            </div>
            <div>
                <label for="lastname">Last name</label>
                <input type="text" id="lastname" value="" />
            </div>
            <div>
            <label for="sex">Sex</label>
            <input type="radio" name="sex" value="male">Male
            <input type="radio" name="sex" value="female">Female
            </div>
 
            <input type="submit" id="register" value="Sign Up" />&nbsp;&nbsp;&nbsp;or&nbsp;&nbsp;&nbsp;<a href="#login_form" id="login_pop">Log In</a>
 
            </form>
     
         
     
     
     
     
     
     
            <center>
 
            <a class="close" href="#close"></a>
            </center>
        </div>
         
         
            </div>
 
        </div>

Try that maybe?
No, this will not work... you made it even worse.
 

TesoMayn

Boredom, it vexes me.
Oct 30, 2011
1,482
1,482
There is no input with the ID password, it's ID is pass therefore it can NOT work

Also the submit button has the have the input type of submit, not button.
 

Ecko

23:37 [autobots] -!- eckostylez [[email protected]]
Nov 25, 2012
1,398
962
Try:
Code:
<body>
 
 
 
<div class="header">
<div class="wrapper">
<div class="Logo"></div>
<div class="headernav"><font color="white"><b>
Please login or register to enter the Dobby's Network website.</b></font>
</div>
 
        </div>
        </div>
       
       
 
 
               
               
                <div id="wrapper_content">
                <div class="left">
                <div class="box">
                <center><br>
               
                <a href="#login_form" id="login_pop">
                <img src="images/login.png"/></a>
                <br><br>
                </center>
                </div>
                </div>
           
                    <div class="right">
                        <div class="box">
                        <center><br>
           
           
                <a href="#join_form" id="join_pop">
                <img src="images/register.png"/></a>
           
                <br><br>
                </center>
                </div>
                </div>
            <br><br><center>
                <font color="red"><b><p>Warning: This is just a DEMO. Nothing actually works here at the moment<p></b></font>
                <center>
               
                <!-- Popups -->
 
 
 
 
 
 
                <a href="#x" class="overlay" id="login_form"></a>
                <div class="popup">
               
            <h2>Welcome Guest!</h2>
            <p>Please login to gain access to the full website.</p><br>
            <div>
                <label for="login">Email</label>
                <input type="text" id="login" value="" />
            </div>
            <div>
                <label for="password">Password</label>
                <input type="password" id="password" value="" />
            </div>
            <center>
            <input type="button" name="login" value="Log In" />
           
            </center>
 
            <a class="close" href="#close"></a>
        </div>
 
     
 
 
 
 
 
 
      <!-- popup form #2 -->
 
       
        <a href="#x" class="overlay" id="join_form"></a>
        <div class="popup">
       
       
       
        <?
 
include_once"config.php";
if (isset($_POST['register'])) {
    $email = $_POST['email'];
    $password = $_POST['password'];
    $firstname = strip_tags(mysql_real_escape_string($_POST['firstname']));
    $lastname = strip_tags(mysql_real_escape_string($_POST['lastname']));
    $memip = $_SERVER['REMOTE_ADDR'];
    $date = date("d-m-Y");
    if (empty($email) OR empty($password)) {
        $final_report.= "Please complete the form below..";
    }
        else {
            $check_members = mysql_query("SELECT * FROM `members` WHERE `email` = '$email'") or die(mysql_error());
            if (mysql_num_rows($check_members) != 0) {
                $final_report.="The username is already in use!";
            } else if (strlen($password) <= 6 || strlen($password) >= 12) {
                    $final_report.="Your password must be between 6 and 12 digits and characters..";
                } else if (!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email)) {
                        $final_report.="Your email address was not valid..";
                    } else {
                        $create_member = mysql_query("INSERT INTO `members` (`id`,`email`, `password`, `firstname`, `lastname`, `ip`, `date`)
VALUES('','$email','$password','$firstname','$lastname','$memip','$date')");
                        $final_report.="Thank you for registering, you may login.";
                    }
                }
            }
 
echo "I didn't set the register POST.";
?>
       
       
       
       
       
       
       
       
       
       
       
            <h2>Sign Up</h2>
            <p>Please enter the details you would like to<br>
            register with here. You MUST be <br>atleast thirteen
            to register.</p><br>
            <form action="" method="post">
            <div>
                <label for="email">Email</label>
                <input type="text" id="email" value="" />
            </div>
            <div>
                <label for="pass">Password</label>
                <input type="password" id="password" value="" />
            </div>
            <div>
                <label for="firstname">First name</label>
                <input type="text" id="firstname" value="" />
            </div>
            <div>
                <label for="lastname">Last name</label>
                <input type="text" id="lastname" value="" />
            </div>
            <div>
            <label for="sex">Sex</label>
            <input type="radio" name="sex" value="male">Male
            <input type="radio" name="sex" value="female">Female
            </div>
            <input type="submit" id="register" value="Sign Up" />
            </form>
           
           
           
            <center>&nbsp;&nbsp;&nbsp;or&nbsp;&nbsp;&nbsp;<a href="#login_form" id="login_pop">Log In</a>
 
            <a class="close" href="#close"></a>
            </center>
        </div>
               
               
            </div>
 
        </div>
 

Tanis

New Member
Jan 5, 2011
22
6
Try:

HTML:
<body>
 
 
 
<div class="header">
<div class="wrapper">
<div class="Logo"></div>
<div class="headernav"><font color="white"><b>
Please login or register to enter the Dobby's Network website.</b></font>
</div>
 
        </div>
        </div>
     
     
 
 
             
             
                <div id="wrapper_content">
                <div class="left">
                <div class="box">
                <center><br>
             
                <a href="#login_form" id="login_pop">
                <img src="images/login.png"/></a>
                <br><br>
                </center>
                </div>
                </div>
         
                    <div class="right">
                        <div class="box">
                        <center><br>
         
         
                <a href="#join_form" id="join_pop">
                <img src="images/register.png"/></a>
         
                <br><br>
                </center>
                </div>
                </div>
            <br><br><center>
                <font color="red"><b><p>Warning: This is just a DEMO. Nothing actually works here at the moment<p></b></font>
                <center>
             
                <!-- Popups -->
 
 
 
 
 
 
                <a href="#x" class="overlay" id="login_form"></a>
                <div class="popup">
             
            <h2>Welcome Guest!</h2>
            <p>Please login to gain access to the full website.</p><br>
            <div>
                <label for="login">Email</label>
                <input type="text" id="login" value="" />
            </div>
            <div>
                <label for="password">Password</label>
                <input type="password" id="password" value="" />
            </div>
            <center>
            <input type="button" name="login" value="Log In" />
         
            </center>
 
            <a class="close" href="#close"></a>
        </div>
 
   
 
 
 
 
 
 
      <!-- popup form #2 -->
 
     
        <a href="#x" class="overlay" id="join_form"></a>
        <div class="popup">
     
     
     
        <?
 
include_once "config.php";
if (isset($_POST['register'])) {
    $email = $_POST['email'];
    $password = $_POST['password'];
    $firstname = strip_tags(mysql_real_escape_string($_POST['firstname']));
    $lastname = strip_tags(mysql_real_escape_string($_POST['lastname']));
    $memip = $_SERVER['REMOTE_ADDR'];
    $date = date("d-m-Y");
    if (empty($email) OR empty($password)) {
        $final_report.= "Please complete the form below..";
    }
        else {
            $check_members = mysql_query("SELECT * FROM `members` WHERE `email` = '$email'") or die(mysql_error());
            if (mysql_num_rows($check_members) != 0) {
                $final_report.="The username is already in use!";
            } else if (strlen($password) <= 6 || strlen($password) >= 12) {
                    $final_report.="Your password must be between 6 and 12 digits and characters..";
                } else if (!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email)) {
                        $final_report.="Your email address was not valid..";
                    } else {
                        $create_member = mysql_query("INSERT INTO `members` (`id`,`email`, `password`, `firstname`, `lastname`, `ip`, `date`)
VALUES('','$email','$password','$firstname','$lastname','$memip','$date')");
                        $final_report.="Thank you for registering, you may login.";
                    }
                }
            }
 
echo "I didn't set the register POST.";
?>
     
     
     
     
     
     
     
     
     
     
     
            <h2>Sign Up</h2>
            <p>Please enter the details you would like to<br>
            register with here. You MUST be <br>atleast thirteen
            to register.</p><br>
            <form action="" method="post">
            <div>
                <label for="email">Email</label>
                <input type="text" name="email" value="" />
            </div>
            <div>
                <label for="pass">Password</label>
                <input type="password" name="password" value="" />
            </div>
            <div>
                <label for="firstname">First name</label>
                <input type="text" name="firstname" value="" />
            </div>
            <div>
                <label for="lastname">Last name</label>
                <input type="text" name="lastname" value="" />
            </div>
            <div>
            <label for="sex">Sex</label>
            <input type="radio" name="sex" value="male">Male</input>
            <input type="radio" name="sex" value="female">Female</input>
            </div>
            <input type="submit" id="register" value="Sign Up" />
            </form>
         
         
         
            <center>&nbsp;&nbsp;&nbsp;or&nbsp;&nbsp;&nbsp;<a href="#login_form" id="login_pop">Log In</a>
 
            <a class="close" href="#close"></a>
            </center>
        </div>
             
             
            </div>
 
        </div>
 

Tanis

New Member
Jan 5, 2011
22
6
Try:

HTML:
<body>
 
 
 
<div class="header">
<div class="wrapper">
<div class="Logo"></div>
<div class="headernav"><font color="white"><b>
Please login or register to enter the Dobby's Network website.</b></font>
</div>
 
        </div>
        </div>
   
   
 
 
           
           
                <div id="wrapper_content">
                <div class="left">
                <div class="box">
                <center><br>
           
                <a href="#login_form" id="login_pop">
                <img src="images/login.png"/></a>
                <br><br>
                </center>
                </div>
                </div>
       
                    <div class="right">
                        <div class="box">
                        <center><br>
       
       
                <a href="#join_form" id="join_pop">
                <img src="images/register.png"/></a>
       
                <br><br>
                </center>
                </div>
                </div>
            <br><br><center>
                <font color="red"><b><p>Warning: This is just a DEMO. Nothing actually works here at the moment<p></b></font>
                <center>
           
                <!-- Popups -->
 
 
 
 
 
 
                <a href="#x" class="overlay" id="login_form"></a>
                <div class="popup">
           
            <h2>Welcome Guest!</h2>
            <p>Please login to gain access to the full website.</p><br>
            <div>
                <label for="login">Email</label>
                <input type="text" id="login" value="" />
            </div>
            <div>
                <label for="password">Password</label>
                <input type="password" id="password" value="" />
            </div>
            <center>
            <input type="button" name="login" value="Log In" />
       
            </center>
 
            <a class="close" href="#close"></a>
        </div>
 
 
 
 
 
 
 
 
      <!-- popup form #2 -->
 
   
        <a href="#x" class="overlay" id="join_form"></a>
        <div class="popup">
   
   
   
        <?
 
include_once "config.php";
if (isset($_POST['register'])) {
    $email = $_POST['email'];
    $password = $_POST['password'];
    $firstname = strip_tags(mysql_real_escape_string($_POST['firstname']));
    $lastname = strip_tags(mysql_real_escape_string($_POST['lastname']));
    $memip = $_SERVER['REMOTE_ADDR'];
    $date = date("d-m-Y");
    if (empty($email) OR empty($password)) {
        $final_report.= "Please complete the form below..";
    }
        else {
            $check_members = mysql_query("SELECT * FROM `members` WHERE `email` = '$email'") or die(mysql_error());
            if (mysql_num_rows($check_members) != 0) {
                $final_report.="The username is already in use!";
            } else if (strlen($password) <= 6 || strlen($password) >= 12) {
                    $final_report.="Your password must be between 6 and 12 digits and characters..";
                } else if (!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email)) {
                        $final_report.="Your email address was not valid..";
                    } else {
                        $create_member = mysql_query("INSERT INTO `members` (`id`,`email`, `password`, `firstname`, `lastname`, `ip`, `date`)
VALUES('','$email','$password','$firstname','$lastname','$memip','$date')");
                        $final_report.="Thank you for registering, you may login.";
                    }
                }
            }
 
echo "I didn't set the register POST.";
?>
   
   
   
   
   
   
   
   
   
   
   
            <h2>Sign Up</h2>
            <p>Please enter the details you would like to<br>
            register with here. You MUST be <br>atleast thirteen
            to register.</p><br>
            <form action="" method="post">
            <div>
                <label for="email">Email</label>
                <input type="text" name="email" value="" />
            </div>
            <div>
                <label for="pass">Password</label>
                <input type="password" name="password" value="" />
            </div>
            <div>
                <label for="firstname">First name</label>
                <input type="text" name="firstname" value="" />
            </div>
            <div>
                <label for="lastname">Last name</label>
                <input type="text" name="lastname" value="" />
            </div>
            <div>
            <label for="sex">Sex</label>
            <input type="radio" name="sex" value="male">Male</input>
            <input type="radio" name="sex" value="female">Female</input>
            </div>
            <input type="submit" name="register" value="Sign Up" />
            </form>
       
       
       
            <center>&nbsp;&nbsp;&nbsp;or&nbsp;&nbsp;&nbsp;<a href="#login_form" id="login_pop">Log In</a>
 
            <a class="close" href="#close"></a>
            </center>
        </div>
           
           
            </div>
 
        </div>

Since you're checking if the button is actually being posted...
 

Users who are viewing this thread

Top