Can anyone tell me why I get this error?

Here’s my coding

<?php include 'connect.php'; echo '
'; echo '

Register

'; foreach($_POST as $key => $value) { $$key = mysql_real_escape_sring($value); } if($_SERVER['REQEUST_METHOD'] != 'POST') { include 'registerform.php'; } else { $errors = array(); if(!ctype_alnum($username)) { $errors[] = 'Your username must contain numbers and letters only!'; } if(strlen($username) > 30 || strlen($useranme) < 5) { $erros[] = 'Your username must be between 5 and 30 characters.'; } if(isset($user_password)) { if($user_password != $confirm_user_pass) { $errors[] = 'You passwords did not match!'; } } if(strlen($user_password) < 5) { $errors[] = 'Your password must be greater than 5 characters.'; } $usercheck = "SELECT username FROM Users WHERE username = '$username'"; $usercheck_query = mysql_query($usercheck); $usercheck_result = mysql_num_rows($usercheck_query); if($user_query > 0) { $errors[] = 'This username is already in use, please try again.'; } if(!empty($errors)) { echo 'Please fix the following errors:

'; echo '
    '; foreach($errors as $key => $value) { echo '
  • ' . $value . '
  • '; } echo '

'; include 'registerform.php'; } else { $cryptpass = hash_hmac('sha512', $user_password, 'asaltforthepassword'); $sql = "INSERT INTO Users(username, user_password) VALUES('". mysql_real_excape_string($username).'" '. $cryptpass .', NOW(), 0, 0)'; $result = mysql_query($sql) if($result) { echo 'Something went wrong while registering, try again'; echo mysql_error(); include 'registerform.php'; } else { echo 'Account successfully created.'; } } } echo '
'; ?>

I don’t know what error your getting, but you have two $$ on key, should only be 1 $.

This is the error I’m getting

Parse error: syntax error, unexpected T_IF in /home/a1146222/public_html/register2.php on line 82

by the way, I’m the guy that posted this thread, I had to make an account to reply

Dang, was hoping somebody knew what was wrong.

What is on line 82? check to make sure all your if statements are terminated properly (all the { have matching }).

the only thing on line 82 is

if($result)

Well the next line after better be a {

What’s the line before?

Make sure every { has a matching } same with [], “”, ‘’

your line;

$result = mysql_query($sql)

is missing a semicolon!

thanks for the help!

Sponsor our Newsletter | Privacy Policy | Terms of Service