Parse error: syntax error, unexpected T_IF

Discussion and education for beginner / novice programmers interested in embarking on the development process to take advantage of the extensible nature of the Joomla! CMS.
Locked
aby_rad
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Mon Oct 08, 2007 8:29 am
Location: KL
Contact:

Parse error: syntax error, unexpected T_IF

Post by aby_rad » Wed Nov 14, 2007 2:48 am

Parse error: syntax error, unexpected T_IF in D:\xampp\htdocs\Joomla\components\com_user\user.php on line 209

the code :

Code: Select all

	$database2 = new database( "localhost", "xx", "xx", "xx", "");	
	

	$query = "UPDATE userprofile"
		. "\n SET fullname = " . $database->Quote($row->name)
		. "\n, email = " . $database->Quote($row->email)
		. "\n, password = " . $database->Quote($row->password)
		. "\n, deviceBrand = " . $database->Quote($_POST['deviceBrand'])
		. "\n, deviceModel = " . $database->Quote($_POST['deviceModel'])
		. "\n, mobileNumber = " . $database->Quote($_POST['mobileNumber'])
		. "\n, icNo = " . $database->Quote($_POST['icNo'])
		. "\n, dob = " . $database->Quote($_POST['dob'])
		
		if ( $_POST['ethnicity']=="Others" )
		{
		. "\n, ethnicity = " . $database->Quote($_POST['other_ethnic'])
		}	
		else { 
			. "\n, ethnicity = " . $database->Quote($_POST['ethnicity'])	 
			}  	
					  
		
		   if ( $_POST['religion']=="Others" );
		   {
		   . "\n, religion = " . $database->Quote($_POST['other_religion'])
		}	else { 
		   . "\n, religion = " . $database->Quote($_POST['religion'])
		  }
		
		. "\n, country = " . $database->Quote($_POST['country'])
		. "\n, state = " . $database->Quote($_POST['state'])
		. "\n, address = " . $database->Quote($_POST['address'])
		. "\n, city = " . $database->Quote($_POST['city'])
		. "\n, postcode = " . $database->Quote($_POST['postcode'])
		. "\n, interest = " . $database->Quote($_POST['interest'])
		. "\n WHERE userID = " . $database->Quote( $orig_username );
		$database2->setQuery( $query );
		$database2->query();
	print ("query >> $query <br>");
		


and this is line 209

Code: Select all

		if ( $_POST['ethnicity']=="Others" )
		{
		. "\n, ethnicity = " . $database->Quote($_POST['other_ethnic'])
		}	
		else { 
			. "\n, ethnicity = " . $database->Quote($_POST['ethnicity'])	 
			}  	
					  
		
		   if ( $_POST['religion']=="Others" );
		   {
		   . "\n, religion = " . $database->Quote($_POST['other_religion'])
		}	else { 
		   . "\n, religion = " . $database->Quote($_POST['religion'])
		  }

im newbie in joomla n php..plis help me..

Locked

Return to “Joomla! Coding 101”