错误如下:Parse error: syntax error, unexpected T_STRING in D:\wamp\www\1.5\newHouse\detail.php on line 17我找到detail.php这段代码 。
//id
$id = intval($_GET['id']);
if($page->action=='save'){
$borough_id = $_GET['borough_id'];
$_POST['borough_id'] = $borough_id;
$borough->saveIntention($_POST);        ------------------------------这个是第17行
    $page->goto('d-'.$borough_id.'.html','成功提交您的意向');
}
if(!$id){
$page->goto('index.php');
}
是不是说  $borough->saveIntention($_POST);         没有这个变量。无法保存。 因为我是修改代码。这个代理所以得变量、类都放在 一个common里面的  比如 Bargain.class.php  这样的文件里附上源代码<?phpclass Borough {
var $db = NULL;
var $tName = 'fke_borough';
var $tNameInfo = 'fke_borough_info';
var $tNamePic = 'fke_borough_pic';
var $tNameDraw = 'fke_borough_draw';
var $tNameAdviser = 'fke_borough_adviser';
var $tNameUpdate = 'fke_borough_update';
var $tNameMember = 'fke_member';
var $tNameMemberInfo = 'fke_broker_info';
var $tNameEvaluate = 'fke_borough_evaluate';
function Borough($db) {
$this->db = $db;
}
function getList($pageLimit,$flag = 0,$where_clouse = '',$order='') {
$where =' where 1 = 1';
if($where_clouse){
$where .= $where_clouse;
}
if($flag == 1){
$where .= " and is_checked = 1 ";
}elseif($flag == 2){
$where .= " and is_checked = 0 ";
}
$this->db->open('select * from '.$this->tName.$where.' '.$order ,$pageLimit['rowFrom'],$pageLimit['rowTo']);
$result = array();
while ($rs = $this->db->next()) {
$result[] = $rs;
}
return $result;
}
function save($fileddata) {
global $cfg;
$fileddata['boroughInfo']['borough_support'] = implode(',',(array)$fileddata['boroughInfo']['borough_support'] );
$fileddata['boroughInfo']['borough_sight'] = implode(',',(array)$fileddata['boroughInfo']['borough_sight'] );
$fileddata['borough']['borough_letter'] = GetPinyin($fileddata['borough']['borough_name'].$fileddata['borough']['borough_alias'],1);
$fileddata['borough']['updated'] = $cfg['time'];
if(!$fileddata['borough']['borough_thumb']){
if(is_array($fileddata['borough_picture_thumb'])){
$fileddata['borough']['borough_thumb']  = $fileddata['borough_picture_thumb'][0];
}
}
if($fileddata['id']){
$borough_id= intval($fileddata['id']);
$this->db->update($this->tName,$fileddata['borough'],'id = '.$borough_id);
$this->db->update($this->tNameInfo,$fileddata['boroughInfo'],'id = '.$borough_id);
$this->db->execute('delete from '.$this->tNamePic.' where borough_id ='.$borough_id);
if(is_array($fileddata['borough_picture_url'])){
foreach($fileddata['borough_picture_url'] as $key =>$pic_url){
$imgField = array(
'pic_url'=>$pic_url,
'pic_thumb'=>$fileddata['borough_picture_thumb'][$key],
'pic_desc'=>$fileddata['borough_picture_desc'][$key],
'borough_id'=>$borough_id,
'creater'=>$fileddata['creater'],
'addtime'=>$cfg['time'],
);
$this->db->insert($this->tNamePic,$imgField);
}
}
$this->db->execute('delete from '.$this->tNameDraw.' where borough_id ='.$borough_id);
if(is_array($fileddata['borough_drawing_url'])){
foreach($fileddata['borough_drawing_url'] as $key =>$pic_url){
$imgField = array(
'pic_url'=>$pic_url,
'pic_thumb'=>$fileddata['borough_drawing_thumb'][$key],
'pic_desc'=>$fileddata['borough_drawing_desc'][$key],
'borough_id'=>$borough_id,
'creater'=>$fileddata['creater'],
'addtime'=>$cfg['time'],
);
$this->db->insert($this->tNameDraw,$imgField);
}
}
}else{
$fileddata['borough']['is_checked'] = 1;
$fileddata['borough']['creater'] = $fileddata['creater'];
$fileddata['borough']['created'] = $cfg['time'];
$this->db->insert($this->tName,$fileddata['borough']);
$borough_id = $this->db->getInsertId();
$fileddata['boroughInfo']['id'] = $borough_id;
$this->db->insert($this->tNameInfo,$fileddata['boroughInfo']);
if(is_array($fileddata['borough_picture_url'])){
foreach($fileddata['borough_picture_url'] as $key =>$pic_url){
$imgField = array(
'pic_url'=>$pic_url,
'pic_thumb'=>$fileddata['borough_picture_thumb'][$key],
'pic_desc'=>$fileddata['borough_picture_desc'][$key],
'borough_id'=>$borough_id,
'creater'=>$fileddata['creater'],
'addtime'=>$cfg['time'],
);
$this->db->insert($this->tNamePic,$imgField);
}
}}
?>
  代码太长 我只截取了部分,,不然发布上来 请问 这个怎么解决???这个变量如何定义?

解决方案 »

  1.   


    老兄是这样的,,这个程序现在升级了1.3。common/apps 下所有的*.class.php 都被zend加密了,用zedener脱壳之后发现里面有很多混淆函数搞不掉。 里面肯定添加了不少变量和参数,, 我用1.2的common/apps 直接替换这个1.3的,所以程序新增的一些功能就出现错误。。明白我说的意思吗?可以给我个思路吗???到目前为止也只有几个函数搞不定比如://id
    $id = intval($_GET['id']);
    if($page->action=='save'){
    $borough_id = $_GET['borough_id'];
    $_POST['borough_id'] = $borough_id;
    $borough->saveIntention($_POST); ------------------------------这个是第17行
      $page->goto('d-'.$borough_id.'.html','成功提交您的意向'); 
    }
    if(!$id){
    $page->goto('index.php');
    }
    这里的第17行就不能写入数据库了。。
      

  2.   


    程序用了smarty  模板分离的。$_post应该是从 *.tpl中来的 不知道对不对。。
      

  3.   

    贴出 detail.php 的 18行以前的全部内容
      

  4.   


    <?php
    require('path.inc.php');
    $page->name = 'detail'; //页面名字,和文件名相同
    //小区
    $borough = new Borough($query);
    //区域字典
    $cityarea_option = Dd::getArray('cityarea');
    $page->tpl->assign('cityarea_option', $cityarea_option);//id
    $id = intval($_GET['id']);
    if($page->action=='save'){
    $borough_id = $_GET['borough_id'];
    $_POST['borough_id'] = $borough_id;
    $borough->saveIntention($_POST);
        $page->goto('d-'.$borough_id.'.html','成功提交您的意向');
    }
    if(!$id){
    $page->goto('index.php');
    }//小区详细信息
    $boroughInfo = $borough->getInfo($id,'*',1,true);
    $boroughInfo['cityarea_name'] = $cityarea_option[$boroughInfo['cityarea_id']];
    $boroughInfo['borough_section'] = Dd::getCaption('borough_section',$boroughInfo['borough_section']);
    $boroughInfo['borough_support'] = Dd::getCaption('borough_support',$boroughInfo['borough_support']);
    $boroughInfo['borough_sight'] = Dd::getCaption('borough_sight',$boroughInfo['borough_sight']);
    $boroughInfo['borough_type'] = Dd::getCaption('borough_type',$boroughInfo['borough_type']);
    $boroughInfo['unsign_percent_change'] = abs($boroughInfo['percent_change']);//小区图片
    $boroughImageList = $borough->getImgList($id,0,4);
    $page->tpl->assign('boroughImageList', $boroughImageList);
    $borough_img_num = count($boroughImageList);
    if($borough_img_num%2){
    $borough_img_num = 2-$borough_img_num%2;
    $page->tpl->assign('borough_img_num', $borough_img_num);
    }
    if(!$boroughInfo['borough_thumb']){
    if($boroughImageList){
    $boroughInfo['borough_thumb'] = $boroughImageList[0]['pic_url'];
    $borough->updateThumb($boroughInfo['id'],$boroughInfo['borough_thumb']);
    }
    }
    $page->tpl->assign('dataInfo', $boroughInfo);//小区户型图
    $boroughDrawList = $borough->getImgList($id,1,4);
    $page->tpl->assign('boroughDrawList', $boroughDrawList);
    $borough_draw_num = count($boroughDrawList);
    if($borough_draw_num%2){
    $borough_draw_num = 2-$borough_draw_num%2;
    $page->tpl->assign('borough_draw_num', $borough_draw_num);
    }//价格小区
    $samePriceBorough =$borough->getList(array('rowFrom'=>0,'rowTo'=>5),1,' and id<>'.$id.' and isdel =0 and isnew =1 and borough_avgprice >='.($boroughInfo['borough_avgprice']-200).' and borough_avgprice<='.($boroughInfo['borough_avgprice']+200),'order by borough_avgprice desc');
    $page->tpl->assign('samePriceBorough', $samePriceBorough);//cityarea小区
    $sameCityareaBorough =$borough->getList(array('rowFrom'=>0,'rowTo'=>5),1,' and id<>'.$id.' and isdel =0 and isnew =1 and cityarea_id = '.$boroughInfo['cityarea_id'],'order by updated desc');
    $page->tpl->assign('sameCityareaBorough', $sameCityareaBorough);//网友察看
    $boroughClickList =$borough->getList(array('rowFrom'=>0,'rowTo'=>5),1,' and id<>'.$id.' and isdel =0 and isnew =1','order by rand() desc');
    $page->tpl->assign('boroughClickList', $boroughClickList);//页面标题
    $page->title = $boroughInfo['borough_name'].'的楼盘概况 - '.$page->title;//关键词
    $page->keyword = '哈尔滨新楼盘,哈尔滨租房,哈尔滨二手房,哈尔滨'.$boroughInfo['borough_name'].'的楼盘概况';
    //增加计数
    $borough->increase($boroughInfo['id'],'click_num');$page->tpl->assign('boroughAdviserList', $boroughAdviserList);
    $page->show();
    ?>
      

  5.   

    $borough->saveIntention//该类下有这个函数吗?你贴的代码里没有呢?
    $_POST是否为NULL?
      

  6.   


    正如你说说$borough->saveIntention//该类下没有这个函数   ,我该怎么定义这个函数?? 需要提供什么你给我说下 我贴上来~`  
      

  7.   

    Parse error: syntax error, unexpected T_STRING in ...
    解析错误:语法错误,在意外T_STRING ...但是你贴出的代码并没有这个错误
      

  8.   


    我把类也贴出。 是经过zend加密 然后脱壳之后  里面一堆的混淆函数看不懂。我自己也不会重新定义。<?php
    /*********************/
    /*                   */
    /*  Version : 5.1.0  */
    /*  Author  : RM     */
    /*  Comment : 071223 */
    /*                   */
    /*********************/class Borough
    { public $db = NULL;
    public $tName = "fke_borough";
    public $tNameInfo = "fke_borough_info";
    public $tNamePic = "fke_borough_pic";
    public $tNameIntention = "fke_borough_intention";
    public $tNameDraw = "fke_borough_draw";
    public $tNameAdviser = "fke_borough_adviser";
    public $tNameUpdate = "fke_borough_update";
    public $tNameMember = "fke_member";
    public $tNameMemberInfo = "fke_broker_info";
    public $tNameEvaluate = "fke_borough_evaluate"; public function Borough( $_obfuscate_sx8 )
    {
    $this->db = $_obfuscate_sx8;
    } public function getList( $_obfuscate_9mdlt1vTxfZC, $_obfuscate_VBYNJA = 0, $_obfuscate_gPNu9hSZExm_Y_4 = "", $_obfuscate_H9Mbnw = "" )
    {
    $_obfuscate_IRFhnYw = " where 1 = 1";
    if ( $_obfuscate_gPNu9hSZExm_Y_4 )
    {
    $_obfuscate_IRFhnYw .= $_obfuscate_gPNu9hSZExm_Y_4;
    }
    if ( $_obfuscate_VBYNJA == 1 )
    {
    $_obfuscate_IRFhnYw .= " and is_checked = 1 ";
    }
    else if ( $_obfuscate_VBYNJA == 2 )
    {
    $_obfuscate_IRFhnYw .= " and is_checked = 0 ";
    }
    $this->db->open( "select * from ".$this->tName.$_obfuscate_IRFhnYw." ".$_obfuscate_H9Mbnw, $_obfuscate_9mdlt1vTxfZC['rowFrom'], $_obfuscate_9mdlt1vTxfZC['rowTo'] );
    $_obfuscate_xs33Yt_k = array( );
    while ( $_obfuscate_SF4 = $this->db->next( ) )
    {
    $_obfuscate_xs33Yt_k[] = $_obfuscate_SF4;
    }
    return $_obfuscate_xs33Yt_k;
    } public function getIntentionList( $_obfuscate_gPNu9hSZExm_Y_4 = "", $_obfuscate_H9Mbnw = "" )
    {
    $_obfuscate_IRFhnYw = " where ";
    if ( $_obfuscate_gPNu9hSZExm_Y_4 )
    {
    $_obfuscate_IRFhnYw .= $_obfuscate_gPNu9hSZExm_Y_4;
    }
    $this->db->open( "select * from ".$this->tNameIntention.$_obfuscate_IRFhnYw." ".$_obfuscate_H9Mbnw );
    $_obfuscate_xs33Yt_k = array( );
    while ( $_obfuscate_SF4 = $this->db->next( ) )
    {
    $_obfuscate_xs33Yt_k[] = $_obfuscate_SF4;
    }
    return $_obfuscate_xs33Yt_k;
    }
      

  9.   

    zend反编译以后不一定能当正常程序使用的你先用zend过的试试,看问题在哪
      

  10.   


    用zend过的正常 一点问题都没有。。 脱壳之后的就不行了。但是zend 都加密了 看不到代码呀 ??、 能有什么办法 其实用原来的替换 问题也不大  就后台新增几个函数变量不能用了。
      

  11.   

    zend反编译一般用来了解原系统的结构、原函数的方法。。如果你能完全理解,可以按照他的思路重新写一个。