Jump to content

[SOLVED] PHP syntax error


mystified

Recommended Posts

I am upgrading a two year old modification for an Invision Power Board. I have run into a problem that is causing a syntax error.  Here is the section:

$set = array(  
				   'bday_day'    => $this->ipsclass->input['day'],
				   'bday_month'  => $this->ipsclass->input['month'],
				   'bday_year'   => $this->ipsclass->input['year'],
				);

	$bet = array(  'website'     => $this->ipsclass->input['WebSite'],
				   'icq_number'  => intval($this->ipsclass->input['ICQNumber']),
				   'aim_name'    => $this->ipsclass->input['AOLName'],
				   'yahoo'       => $this->ipsclass->input['YahooName'],
				   'msnname'     => $this->ipsclass->input['MSNName'],
				   'location'    => $this->class->parser->bad_words( $this->ipsclass->input['Location'] ),
				   'interests'   => $this->class->parser->bad_words( $this->ipsclass->input['Interests'],

				$this->ipclass->input['cpu'],

				$this->ipsclass->input['ram'],

				$this->ipsclass->input['gfx'],

				$this->ipsclass->input['hdd'],

				$this->ipsclass->input['os'],

				$this->ipsclass->input['sound'],
				$this->ipsclass->input['monitor'],

				$this->ipsclass->input['mouse'],
				$this->ipsclass->input['keyboard'],



			$_gender=$this->ipsclass->input['gender'] == 'male' ? 'male' : ( $this->ipsclass->input['gender'] == 'female' ? 'female' : '' ),

 

Before I added the computer specs there were two ); after interests.  If I add them after keyboard then I get an error message that they don't belong.  If I leave them out then I get a syntax error further down. I know this area needs to be closed somehow but I am not a php programmer.  I'd really appreciate some help.

 

Thank you

 

 

Link to comment
https://forums.phpfreaks.com/topic/52525-solved-php-syntax-error/
Share on other sites

Im not 100% certain but i believe if you remove the comma as show below your problem will be solved:

 

 

Try changing this code (Line 4)

'bday_year'   => $this->ipsclass->input['year'],

to

'bday_year'   => $this->ipsclass->input['year']

 

simply removing the comma at the end of the line as it is the last value you have entered into your array

That causes a Parse error: syntax error, unexpected T_IF

in the first line which is the next section after the male female code.

		//-----------------------------------------
	// check to see if we can enter a member title
	// and if one is entered, update it.
	//-----------------------------------------

	if ( (isset($this->ipsclass->input['member_title'])) and ( isset($this->ipsclass->vars['post_titlechange']) ) and ( $this->ipsclass->member['posts'] >= $this->ipsclass->vars['post_titlechange']) )
	{
		$set['title'] = $this->class->parser->bad_words( $this->ipsclass->input['member_title'] );
	}

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.