首页 | 新闻 | 交流 | 问吧 | 文档 | 手册 | 下载 | 博客

收藏此问题 发表新评论

www.buway.cn自助建站系统在生成用户模板时出错,请大家帮帮忙!

在用户生成自己的网站时不能显时完全,主要源文件在这里:
modwebok.php3
<?php
include("includes/db.inc.php");
include("includes/config.php");
$msql=new SHARP_SQL;
$fsql=new SHARP_SQL;
if(!isset($AUTOUSERID) || $AUTOUSERID=="" || $AUTOUSERID=="deleted"){
header("Location: log.php3?fm=modweb.php3");
}else{
$userid=$AUTOUSERID;
}
if($step=="2"){
    SetCookie("MOD", "$mod");
}
?><HTML><HEAD><TITLE></TITLE>
<META content="text/html; charset=??????" http-equiv=Content-Type>
<STYLE>HTML {TEXT-DECORATION: none}



A:link {COLOR: #000000; TEXT-DECORATION: underline}



A:hover {COLOR: rgb(0,147,43); TEXT-DECORATION: underline}



EM {FONT-FAMILY: CourierNew; FONT-SIZE: 16pt; FONT-STYLE: normal}



A {FONT-SIZE: 9pt}



TD {FONT-SIZE: 9pt}



P {



FONT-SIZE: 9pt



}



.hh input {background-color: #ffffff; border-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px}



</STYLE>



</HEAD>



<BODY aLink=#000000 bgColor=#ffffff leftMargin=0 link=#000000 topMargin=0 vLink=#000000 marginwidth="0" marginheight="0">
<table width="100%" border="0" cellspacing="2" cellpadding="0">
  <tr valign="bottom">
    <td height="27"><font color="#000000">■ 选择网页模版</font></td>
  </tr>
  <tr bgcolor="#FF3300">
    <td height="1"><img src="images/dot.gif" width="22" height="1"></td>
  </tr>
  <tr valign="top">
    <td height="272"> <?php
if($step=="2"){
$msql->query("update auto_user set mod='$mod' where userid='$AUTOUSERID'");
$msql->query("select exptime,urlname from auto_user where  userid='$AUTOUSERID'");
   if($msql->next_record()){
        $exptime=$msql->f('exptime');
        $urlname=$msql->f('urlname');

        $userid=$AUTOUSERID;
}


$fd=fopen("make.php3","r");
$con = fread($fd,10000);
fclose($fd);
$con=str_replace("&&&userid&&&",$userid,$con);
$con=str_replace("&&&ver_id&&&",time(),$con);
$con=str_replace("&&&mod&&&","$mod",$con);
$con=str_replace("&&&exptime&&&","$exptime",$con);
$fd=fopen("com/$urlname/index.php3","w");
fwrite($fd,$con,10000);
fclose($fd);
  chmod("com/$urlname/index.php3",0666);
?> <br>
      <form method="post" action="goto.php3" target=_blank>
        <div align="center">模版选择成功,请按以下按钮更新网站:<br>
          <br>
          <input type="submit" name="Submit22" value="更新并预览网站">
          <input type="hidden" name="userid" value="<?php echo "$AUTOUSERID"; ?>">
        </div>
      </form>
      <br>
      <?
exit;
}
?> </td>
  </tr>
</table>
</BODY></HTML>

goto.php3

<?php

include("includes/config.php");

SetCookie("LOOK", "ok");

if(isset($URLNAME) && isset($EXPTIME) && isset($AUTOUSERID) && isset($MOD)){

$urlname=$URLNAME;

$url=$baseurl."com/".$urlname;

$fd=fopen("make.php3","r");

$con = fread($fd,10000);

fclose($fd);

$con=str_replace("&&&userid&&&",$AUTOUSERID,$con);

$con=str_replace("&&&ver_id&&&",time(),$con);

$con=str_replace("&&&mod&&&",$MOD,$con);

$con=str_replace("&&&exptime&&&",$EXPTIME,$con);

$fd=fopen("com/$urlname/index.php3","w");

fwrite($fd,$con,10000);

fclose($fd);

  chmod("com/$urlname/index.php3",0755);

Header("locationurl");

}else{

echo "请开启电脑的cookie功能,然后重新登录";

echo "$URLNAME $EXPTIME $AUTOUSERID $MOD";

}

?>


make.php3

<?php

include("../../includes/config.php");
$ver_id=&&&ver_id&&&;
$userid=&&&userid&&&;
$mod=&&&mod&&&;
$exptime=&&&exptime&&&;
///////////////////////////////////////
$date = getdate();
                $yy = $date['year'];
                $dd= $date['mday'];
                $mm= $date['mon'];
            if($mm<10){
                $mm="0".$mm;
                }
                if($dd<10){
                $dd="0".$dd;
                }
                $nowtime=$yy.$mm.$dd;

////////////////////////////////////////
if($nowtime>$exptime && $LOOK!="ok"){
header("location:../../exp.htm");
}
if($file==""){
$file="index.php3";
}
if(isset($REF_PAGE)){
  $refpage=$REF_PAGE;
  $direct="N";
}else{
  $direct="Y";
}
$opendir="$baseurl/mod/$mod/";
$openfile=$opendir.$file;
$openfile=$openfile."?kdir=$kdir&nowdir=$nowdir&userid=$userid&id=$id&detail=$detail";
if($QUERY_STRING==""){
  $filestring="file=index.php3.htm";
}else{
  $filestring=$QUERY_STRING.".htm";
}
  setcookie("REF_PAGE",$filestring);
$kk=3;
if(file_exists($filestring)){
  $fx=fopen($filestring,"r");
  $pp=fgets($fx,100);
  fclose($fx);

  if(trim($pp)=="<!-- $ver_id -->"){
     include($filestring);
     
  }else{
     $kk=1;
  }
}else{
  if($filestring=="file=index.php3.htm"){
     $kk=1;
   }elseif($direct=="Y"){
     $kk=0;
   }else{
     if(file_exists($refpage)){
       $ffp=fopen($refpage,"r");
       $fcon=fread($ffp,120000);
       if(strstr($fcon,$QUERY_STRING.">")){
          $kk=1;
       }else{
          $kk=0;
       }
       fclose($ffp);
     }else{
       $kk=0;
     }

   }
}

if($kk==0){
  $fd=fopen($openfile,"r");
  $con = fread($fd,120000);
  $con=str_replace("images/","$opendir/images/",$con);
  $con=str_replace("<?","",$con);
  $con=str_replace("<%","",$con);
  $con=str_replace("language=php","",$con);
  $con=str_replace("language='php'","",$con);
  $con=str_replace('language="php"','',$con);
  fclose($fd);
  echo "$con";
}


if($kk==1){
  $fd=fopen($openfile,"r");
  $con = fread($fd,120000);
  $con=str_replace("images/","$opendir/images/",$con);
  fclose($fd);
  $con=str_replace("<?","",$con);
  $con=str_replace("<%","",$con);
  $con=str_replace("language=php","",$con);
  $con=str_replace("language='php'","",$con);
  $con=str_replace('language="php"','',$con);
  echo "$con";
  $fp=fopen($filestring,"w");
  fwrite($fp,"<!-- $ver_id -->\n",100);
  $con=str_replace("\t","",$con);
  $con=str_replace("\r","",$con);
  $con = ereg_replace(">([ ]+)<", "><", $con);
  $con = ereg_replace("\n([ ]+)<", "\n<", $con);
  $con = ereg_replace("([\n]+)", "\n", $con);
  fwrite($fp,$con,strlen($con));
  fclose($fp);
  chmod($filestring,0666);
}
?>
昵称: thirdfeel  时间: 2003-10-24 17:51:00
看看这个 http://www.sanyangyasuoji.com
昵称: jnbxzl0200106  时间: 2011-08-22 15:32:12