Jump to content

Someone Please help... Major php error


hayw0027

Recommended Posts

My directory has a major php script error.

 

The is the error that shows up on top of my article pages.

 

Parse error: parse error, unexpected T_CASE in /hsphere/local/home/user/domain.com/code/articlems.php(45) : eval()'d code on line 25

 

this is the php code on line 45 of articlems.php

 

  eval($this->templatephp);

 

Line 25 says

 

global $Member;

 

 

where do i look to find the problem? and what would the problem be?

 

Link to comment
https://forums.phpfreaks.com/topic/125906-someone-please-help-major-php-error/
Share on other sites

do you have a Switch statement?  This looks something like:

 

switch ($blah) {

case 1:

//Do Something

case 2:

//Do Something

}

 

This error is saying there is a problem with the case statement.  I would post your code to get a better and more helpful answer than this.  

Thanx for replying

 

Im a dumbass when it comes to php code

 

Since the error is appearing on the article pages i presume thats the php code that has the issues.

 

this is it:

 

 

 

$this->title = $Article->title.' - '.$this->settings['sitename'];

 

$this->meta_description = substr (strip_tags ($Article->summary), 0, 180);

$this->meta_keywords = $Article->keywords;

 

$this->articles = $this->getArticles("article_categoryid = {$Article->Category->id}",'article_id DESC',5);

 

$Article->text = nl2br($Article->text);

 

 

 

if ($Article->keywords) {

  $this->tags = explode(",", $Article->keywords);

  for ($i=0;$i<sizeof($this->tags);$i++) {

      $this->words[$i] = trim($this->tags[$i]);

      $this->tags[$i] = str_replace(" ", "+", $this->words[$i]);

  }

} else {

  $this->words[] = trim($Category->title);

  $this->words[] = trim($Article->title);

  $this->tags[] = str_replace(" ", "+", $this->words[0]);

  $this->tags[] = str_replace(" ", "+", $this->words[1]);

}

 

case "Affiliate Marketing":

  $category_id='18';

  break;

 

case "Article Marketing":

  $category_id='15';

  break;

 

case "Banner Ads":

  $category_id='20';

  break;

 

case "Blogging":

  $category_id='11';

  break;

 

case "Display Marketing":

  $category_id='10';

  break;

 

case "Domain registration":

  $category_id='22';

  break;

 

case "Email Marketing":

  $category_id='9';

  break;

 

 

case "Forum Marketing":

  $category_id='17';

  break;

 

case "Internet Marketing":

  $category_id='19';

  break;

 

case "Link Building":

  $category_id='16';

  break;

 

case "Pay Per Click":

  $category_id='5';

  break;

 

case "RSS":

  $category_id='12';

  break;

 

case "Search Engine Optimization":

  $category_id='1';

  break;

 

case "Social Networking":

  $category_id='8';

  break;

 

case "Video Marketing":

  $category_id='7';

  break;

 

case "Viral marketing":

  $category_id='21';

  break;

 

case "web 2.o":

  $category_id='6';

  break;

 

case "Web Design":

  $category_id='14';

  break;

 

case "Web Hosting":

  $category_id='13';

  break;

 

$Article->text = str_replace('</a>', '', $Article->text);

$Article->text = preg_replace('/(<a[\s]+[^>]+)>/i', '', $Article->text);

 

$this->isarticle = 1;

 

$Article->about = preg_replace('/(<a[\s]+[^>]+)>/i', '\\1 target="_blank">', $Article->about);

 

<?php    ini_set('error_reporting', E_ALL | E_STRICT);    ini_set('display_errors', 'Off');    ini_set('log_errors', 'On');    ini_set('error_log', '/path/to/errorlog');?>

 

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.