jeudi 22 septembre 2016

PHP error: Parse error: syntax error, unexpected '' [duplicate]

This question already has an answer here:

I am getting this error: Parse error: syntax error, unexpected '' (T_ENCAPSED_AND_WHITESPACE), expecting identifier (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING) in ... and I don't know where it comes from.

function registerForm() {

if(isset($_POST['makeuser'])) {
function randomPassword() {
$alphabet = "abcdefghijklmnopqrstuwxyzABCDEFGHIJKLMNOPQRSTUWXYZ0123456789";
for ($i = 0; $i < 8; $i++) {
    $n = rand(0, strlen($alphabet)-1);
    $pass[$i] = $alphabet[$n];
}
return implode($pass);
}
        $muser = mysql_real_escape_string($_POST['user']);
        $mpass = mysql_real_escape_string($_POST['pass']);
        $email = mysql_real_escape_string($_POST['email']);
        $mtype = mysql_real_escape_string($_POST['type']);
        $madeby = mysql_real_escape_string($_POST['madeby']);
        $mdate = mysql_real_escape_string($_POST['date']);
        $mexp = mysql_real_escape_string($_POST['experation']);
        $mactive = mysql_real_escape_string($_POST['active']);
        $hash = md5($muser);

        $query=mysql_query("insert into users (id,username, password, email, type, madeby, date, exp, active, hash ) values('','$muser','$mpass','$email','$mtype','$madeby','$mdate','$mexp','$mactive', '$hash')");
        if($query)
        {
            echo "<p>Thank you ".$muser." for registering to use 123. Before you can use, you must login and use the form to purchase (paypal) to activate your account.</p>";

        }
        else {
            echo "<p>Sorry, we could not process your registration. Please try again later</p>";
        }
    }
    echo "</div>";
}




Aucun commentaire:

Enregistrer un commentaire