0

Hello,

I wonder why this condition does not work:

registration3.php

<?php

    include('includes/koneksi.php');

    $email = isset($_POST['email']) ? $_POST['email'] : '';  
    $confirmation = isset($_POST['confirmation']) ? $_POST['confirmation'] : '';  
    $password = isset($_POST['password']) ? $_POST['password'] : ''; 
    $fname = isset($_POST['fname']) ? $_POST['fname'] : '';
    $lname = isset($_POST['lname']) ? $_POST['lname'] : ''; 
    $gender = isset($_POST['gender']) ? $_POST['gender'] : '';
    $birthdate = isset($_POST['birthdate']) ? $_POST['birthdate'] : '';
    $country = isset($_POST['country']) ? $_POST['country'] : '';
    $phone = isset($_POST['phone']) ? $_POST['phone'] : '';
    $phone2 = isset($_POST['phone2']) ? $_POST['phone2'] : '';
    $address = isset($_POST['address']) ? $_POST['address'] : '';
    $skype = isset($_POST['skype']) ? $_POST['skype'] : '';
    $refferal = isset($_POST['refferal']) ? $_POST['refferal'] : '';
    $term = isset($_POST['term']) ? $_POST['term'] : '';

    //Simpan Registrasi3
    echo "outside";
    if (isset($_POST['register'])){

            echo "test";
            if(!empty($email) && !empty($password) && !empty($fname) && !empty($lname) && !empty($gender) && !empty($birthdate)&& !empty($country)&& !empty($phone)&& !empty($phone2)&& !empty($address)&& !empty($skype) && !empty($refferal) && !empty($term) && $password == $conf_password){

            $sqlstr = "INSERT INTO student(email, password, fname, lname, gender, birthdate, country, phone, phone2, address, skype, refferal, term) VALUES('".$email."','".$password."','".$fname."','".$lname."','".$gender."','".$birthdate."','".$country."','".$phone."','".$phone2."','".$address."','".$skype."','".$refferal."','".$term."')";

            $result = mysql_query($sqlstr) or die(mysql_error());

            echo "successfully inserted".'<br>';
            echo "successfully inserted".'<br>';
            echo "successfully inserted".'<br>';
            echo "successfully inserted".'<br>';
            }
            else
            {
            $error = "Please fill-in all fields information in this form.<br>";
            echo "pass".'<br>';
            echo "pass".'<br>';
            echo "pass".'<br>';
            echo "pass".'<br>';
            $result = "";
            }
        //Jika mode edit, maka tidak akan dikirimkan konfirmasi kepada subscriber
        //if (empty($_REQUEST['id']))   kirimEmail($idKategori, $judul, $news);
        $confirmation = ($result) ? "Data telah tersimpan." : "Gagal menyimpan data.";  
    }


?>          

<h3>PLEASE COMPLETE THE FOLLOWING REGISTRATION PROGRESS!</h3><br><br>

<form id="registration-form">

<table style="width: 1000px">

<img src="images/registrationbar3.png" height="70px" width="850px"><br><br><br>
<?php echo $error; ?>

<form name="registration3" action="<?php $_SERVER['PHP_SELF']; ?>" method="POST">
<tr>
    <td>Email</td>
    <td><input style="width: 500px;" type="text" name="email" size="80px"><br><br></td>
</tr>
<tr>
    <td>Password</td>
    <td><input style="width: 500px;" type="password" name="password" size="80px"><br><br></td>
</tr>
<tr>
    <td>Confirm Password</td>
    <td><input style="width: 500px;" type="password" name="conf_password" size="80px"><br><br></td>
</tr>
<tr>
    <td>Full Name</td>
    <td><input style="width: 240px;" type="text" name="fname" size="36px">&nbsp;&nbsp;<input style="width: 240px;" type="text" name="lname" size="36px"><br><br></td>
</tr>
<tr>
    <td>Gender</td>
    <td><select name="gender" style="width:100px; ">
                <option value="male">Male</option>
                <option value="female">Female</option>                                    
        </select><br><br></td>
</tr>
<tr>
    <td>Birthdate</td>
    <td><input style="width: 150px;" type="text" name="birthdate" size="80px"><br><br></td>
</tr>
<tr>
    <td>Country</td>
    <td><input style="width: 500px;" type="text" name="country" size="80px"><br><br></td>
</tr>
<tr>
    <td>Phone No.</td>
    <td><input type="text" name="phone" size="50px">&nbsp;&nbsp;<br><br></td>
</tr>
<tr>
    <td>Additional Phone No.</td>
    <td><input type="text" name="phone2" size="50px">&nbsp;&nbsp;<br><br></td>
</tr>
<tr>
    <td>Address</td>
    <td><textarea style="width: 300px;" cols="80px" rows="4px" name="address"></textarea><br><br></td>
</tr>
<tr>
    <td>Skype ID</td>
    <td><input style="width: 500px;" type="text" name="skype" size="80px"><br><br></td>
</tr>
<!-- <tr>
    <td>Timezone</td>
    <td><input type="text" name="Skype" size="80px"><br><br></td>
</tr> -->
<tr>
    <td>Refferal Email</td>
    <td><input style="width: 500px;" type="text" name="referral" size="80px"><br><br></td>
</tr>        
    <td></td>
    <td><input type="checkbox" name="vehicle" value="Car">I have read and agree to Squprime terms and conditions
    </td>
</table>       

<?php include('includes/setting.php'); ?>                        

<input type="submit" class="button" name="register" value="next">                          

</form>

</div>

<?php include('footer.php'); ?>

</body>
</html>

I wonder why I do not see echo "test", which means that I do not pass if (isset($_POST['register']))

I thought I already press the next button and type the code correctly.

Please help.

3
Contributors
2
Replies
15
Views
3 Years
Discussion Span
Last Post by Webville312
0

You have two form opening tags, remove:

<form id="registration-form">

And it should work. Bye!

Edited by cereal

0

Just as Cereal has pointed out, you have two <form> tags open.
You could remove one of them, and try again.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.