Parse error: syntax error, unexpected T_IF, expecting ')'
What should I do? .please anyone help me out
$option = $_GET['I-would-like'];
$userdata = array(
'user_login' => $username,
'user_pass' => $password,
'user_email' => $email,
'nickname' => reset($name_parts),
'display_name' => $name,
'first_name' => reset($name_parts),
'last_name' => end($name_parts),
if ($option == 'A quotation' OR $option == 'Information')// Error occurs here
{
'role' => 'customer'
} else if($option == 'To become a Partner')
{
'role' => 'partners'
} else if ($option == 'Training / Coaching')
{
'role' => 'students'
}
);
try this, get role value outside array
$role = "";
$option = $_GET['I-would-like'];
$option = trim($option);
if ($option == 'A quotation' || $option == 'Information')
{
$role = 'customer';
} else if($option == 'To become a Partner')
{
$role = 'partners';
} else if ($option == 'Training / Coaching')
{
$role = 'students';
}
$userdata = array(
'user_login' => $username,
'user_pass' => $password,
'user_email' => $email,
'nickname' => reset($name_parts),
'display_name' => $name,
'first_name' => reset($name_parts),
'last_name' => end($name_parts),
'role' => $role
);
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments