Can I have some php assistance please?

Status
Not open for further replies.

Unidentified

Living the Developer Life...
Jun 19, 2012
144
20
Xenous just made me a register php bit but when i put it on i get this error:Parse error: error, unexpected '{' in F:\xampp\htdocs\register.php on 17

can someone help please me php is:

PHP:
<?php
 
require_once('include.php');
   
    function clean($input)
    {
        return mysql_real_escape_string(htmlspecialchars($input));
    }
   
    function rows($query)
    {
        return mysql_num_rows(mysql_query($query));
    }
   
    if(isset($_POST['firstname']) && isset($_POST['lastname']) && isset($_POST['gender']) && isset($_POST['dob']) && isset($_POST['email']) && isset($_POST['password'])
   
    {
        $fname = clean($_POST['firstname']);
        $lname = clean($_POST['lastname']);
        $gender = clean($_POST['gender']);
        $email = clean($_POST['email']);
        $password = clean(md5($_POST['password']));
        $dob = clean($_POST['dob']);
       
        if(!empty($password) && !empty($fname) && !empty($lname) && !empty($gender) && !empty($dob))
        {
            if(is_int($dob))
            {
                if(rows("SELECT * FROM usersystem WHERE email_name_column='".$fname."'") < 1)
                {
                    //Insert it?
                    mysql_query("INSERT INTO usersystem (firstname, lastname, gender, email, column, joined) VALUES ('".$fname."', '".$lname."', '".$gender."', '".$email."', '".$password."', '".time()."')");
                    header("Location: somefuckingplace.php");
                }
                else
                {
                    //Email taken, should only check this as first names and last names will always clone;
                    echo '<!--Email Taken-->';
                }
 
            }
            else
            {
                //DOB ISNT IT?!
                echo '<!--Dob isn\'t in int form-->';
            }
        }
        else
        {
            //Empty fields error;
            echo '<!--Empty Fields-->';
        }
    }
 
?>
 

Zeus

Active Member
Jun 30, 2012
150
30
Replace

PHP:
    if(isset($_POST['firstname']) && isset($_POST['lastname']) && isset($_POST['gender']) && isset($_POST['dob']) && isset($_POST['email']) && isset($_POST['password'])

With

PHP:
    if(isset($_POST['firstname']) && isset($_POST['lastname']) && isset($_POST['gender']) && isset($_POST['dob']) && isset($_POST['email']) && isset($_POST['password']))
 
Status
Not open for further replies.

Users who are viewing this thread

Top