mystified Posted May 22, 2007 Share Posted May 22, 2007 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 Quote Link to comment https://forums.phpfreaks.com/topic/52525-solved-php-syntax-error/ Share on other sites More sharing options...
AJReading Posted May 22, 2007 Share Posted May 22, 2007 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 Quote Link to comment https://forums.phpfreaks.com/topic/52525-solved-php-syntax-error/#findComment-259192 Share on other sites More sharing options...
mystified Posted May 22, 2007 Author Share Posted May 22, 2007 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'] ); } Quote Link to comment https://forums.phpfreaks.com/topic/52525-solved-php-syntax-error/#findComment-259231 Share on other sites More sharing options...
mystified Posted May 22, 2007 Author Share Posted May 22, 2007 I figured it out. Quote Link to comment https://forums.phpfreaks.com/topic/52525-solved-php-syntax-error/#findComment-259250 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.