首 页   · 站长博客 · 用户注册 · 会员登陆  · 会员排行  ·最新主题  ·最近回复  精华区  版权声明  ·论坛管理
  当前登录身份:游客,请先登录。  笔名: 口令: 验证码:   
楼 主  index »  PHP与模板与代码加密/优化 » [求助]请各位高手帮帮我!在此先谢了.....!!!  


  作者:yjptljhb
  注册时间:2005-04-22
  主题/回复:7/4
  积分:439
  等级:★★☆(五级)
  称号:略有小成

  yjptljhb@163.com..
  173274239
  www.

 

 发表:2005-08-23 06:03:09 阅读 2250 次 回复 3 次 得分1  |   字号 字色
[求助]请各位高手帮帮我!在此先谢了.....!!!
我是刚出道的PHP菜鸟!在调试程序时出现多处错误提示我检查了数据库里的表,字段和文件里的信息好像都没问题,还请高手赐教一二,谢谢!!!

1处:
Warning: main(..\inc\conn.php) [function.main]: failed to open stream: No such file or directory in /home/web/tidynet-cn/tljhb.com/123/category/editcategory.php on line 5

Warning: main() [function.include]: Failed opening '..\inc\conn.php' for inclusion (include_path='.:/usr/local/php/lib/php') in /home/web/tidynet-cn/tljhb.com/123/category/editcategory.php on line 5

Warning: main(..\inc\function.php) [function.main]: failed to open stream: No such file or directory in /home/web/tidynet-cn/tljhb.com/123/category/editcategory.php on line 6

Warning: main() [function.include]: Failed opening '..\inc\function.php' for inclusion (include_path='.:/usr/local/php/lib/php') in /home/web/tidynet-cn/tljhb.com/123/category/editcategory.php on line 6

2处:
Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/web/tidynet-cn/tljhb.com/123/category/editcategory.php on line 39

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/web/tidynet-cn/tljhb.com/123/category/editcategory.php on line 40

3处:
Warning: main(./../inc/contentTransition.php) [function.main]: failed to open stream: No such file or directory in /home/web/tidynet-cn/tljhb.com/123/product/articleedit.php on line 18
4处:
Parse error: parse error, unexpected T_IF in /home/web/tidynet-cn/tljhb.com/123/product/pagesuggestion.php on line 30


请各位大虾帮帮我!不胜感激呀!!!!
 
 1#楼  
 
  回复人:一起PHP
  注册时间:2004-02-27
  主题/回复:247/1521
  积分:4649
  等级:★★★★★☆(十一级)
  称号:论坛圣人

   
 1#楼 发表于2005-08-23 16:25:24  评分:1 

1处:
找不到文件 editcategory.php
打开文件editcategory.php失败
打开文件editcategory.php失败

2处:
mysql_query()提供的参数不是一个有效的MYSQL-link资源类型。
mysql_num_rows()提供的参数不是一个有效的MYSQL-result资源类型。

3处:
找不到文件articleedit.php 

4处:
语法错误:pagesuggestion.php 第30行,无法识别的 IF 关键字。
------------------------------------------------------------------
上面就是这些错误信息。你按照错误信息自己检查一下看看。看你目录,使用的unix/linux系统,而且是一个整站程序吧?如果是从网上下载的整站程序,有时候存在错误也不奇怪。得按照程序提供者的说明,一步一步进行设置和安装。
 2#楼  
 
  回复人:yjptljhb
  注册时间:2005-04-22
  主题/回复:7/4
  积分:439
  等级:★★☆(五级)
  称号:略有小成

   
 2#楼 发表于2005-08-24 06:36:50  评分:× 

班竹!你好非常感谢你给我的回复!
我的这个程序是一个"后台产品管理"程序,以前在另一个服务器上运行很好!
可是换了一个服务器就有问题了,它这原来的程序我没改过,只是将连接数据库中的数据稍改了一下,没理由呀!一字"郁闷!!!!"

1.现将editcategory.php 源码粘贴如下:
<?
//$phpbb_root_path = '../';
//include($phpbb_root_path . 'inc/conn.php');
//include($phpbb_root_path . 'inc/function.php');
include("..\inc\conn.php");
include("..\inc\function.php");
?>
<html>
<head>
<title>产品分类管理——修改分类</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../livestyle.css" rel="stylesheet" type="text/css">
<?
  if ($page="")
  {
    $page=1;
   }
?>
</head>

<body bgcolor="#ffffff">

  <table width="90%" border="0" cellspacing="0" cellpadding="0" height="25" align="center">
    <tr align="middle" bgcolor="#000000">
  <td width="100%" class="white" align="center"><b>修改分类</b></td>
    </tr>
  </table>
<form name="form" method="post" action="editcategorydeal.php?id=<?=$categoryid?>&page=<?=$page?>">

  <table width="90%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#000000">
    <tr bgcolor="#ffffff">
  <td height="22" align="left" bgcolor="#ffffff">分类编号:
    <input name="categoryid" type="text" id="categoryid" value="<?=$categoryid?>" size="18"></td>
    </tr>
    <tr bgcolor="#ffffff">
  <td class="pt9" height="22" bgcolor="#ffffff">  所属父类:
    <?
      $strsql = "select productcategory.categoryid,productcategory.categoryname,productcategory.categoryidp from productcategory where ((productcategory.categoryidp)='')";
  $result = mysql_query($strsql,$db_conn);
  $rowcount = mysql_num_rows($result);
      echo "<select name='categoryidp' id='categoryidp'>";
      echo "<option value=''> 无父类 </option>";
      if ($rowcount>0)
      {
   for ($i=0;$i<$rowcount;$i++)
     {
       $row = mysql_fetch_row($result);
       echo "<option value='";
       echo $row[0];
       echo "'";
       if ($categoryidp == $row[0])
        {
       echo "selected";
         }
       echo ">";
       echo $row[1];
       echo "</option>";
      }
       }
      mysql_close($db_conn);
      echo "</select>";
    ?>
  </td>
    </tr>
    <tr bgcolor="#ffffff">
  <td class="pt9" height="22">  分类名称:
    <input name="categoryname" value="<?=$categoryname?>" size="18"> </td>
    </tr>
    <tr bgcolor="#ffffff">
  <td height="22" align="right" class="pt9"><a href="#" class="blue">添加产品动态分类</a> 
  </td>
    </tr>
    <tr bgcolor="#ffffff">
  <td height="22" align="center" class="pt9"> <input type="submit" name="Submit" value="== 确 定 ==">
    <input type="reset" name="reset1" value="== 重填 =="> </td>
    </tr>
  </table>
    <br>
  <p align="center"> </p>
  </form>
</body>
</html>

2.现将articleedit.php代码粘贴如下:
<html>
<head>
<title>信息修改</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

<link rel="stylesheet" href="../livestyle.css" type="text/css">
</head>
<body>
<table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="506" height="25" align="center" class="tbl-fullpage-subhead">===
  信息修改 ===</td>
  </tr>
</table>
<?php
$phpbb_root_path = './';
include($phpbb_root_path . '../inc/conn.php');
include($phpbb_root_path . '../inc/contentTransition.php');
$sql="select * from article where id='$id'";
$query=mysql_query($sql) or die("数据库操作失败,请重试!");
$resultnum=mysql_num_rows($query);
if ($resultnum==0)
{
echo "<br><br>没有符合条件的信息,请<a href='javascript:history.back();'>返回</a>";
exit;
}
$array=mysql_fetch_array($query);
?>
<br>
<form action=articleeditdo.php name=form1 method=post enctype="multipart/form-data">
  <input type=hidden name=showtitle value="产品介绍">
  <input type=hidden name=id value="<?=$id?>">
  <table width="90%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#000000">
    <tr valign="middle" bgcolor="#FFFFFF">
    <td width="100" height="20" align="right">标题:</td>
    <td width="406" height="20"><input name="subject" type="text" size="40" value='<?=$array[subject]?>'></td>
  </tr>
  <tr valign="middle" bgcolor="#FFFFFF">
    <td width="100" height="20" align="right">内容:</td>
    <td height="20">
    <textarea name=content rows=10 cols=60><?=$array[content]?></textarea></td>
  </tr>
  <?
  for($i=1;$i<=5;$i++)
  {
  $str1="pic".$i;
  ?>
  <tr valign="middle" bgcolor="#FFFFFF">
    <td width="100" height="20" align="right">文件<?=$i?>:</td>
    <td height="20"><?=$array[$str1]?><br><input name="<?=$str1?>" type="file" size="30"></td>
  </tr>
  <?
  }
  ?>
  <tr valign="middle" bgcolor="#FFFFFF">
    <td width="100" height="20" align="right">优先级:</td>
    <td height="20">
    <input name="pri" type="text" size="5" value='<?=$array[pri]?>'>
    (1-100)整数,数值小的优先显示 </td>
  </tr>
  <tr valign="middle" bgcolor="#FFFFFF">
    <td width="100" height="20" align="right">信息类型:</td>
    <td height="20">
    <input type=text name=typename value='<?=$array[type]?>' disabled>
 ==此项为基础信息 不可更改==
    </td>
  </tr>
  <tr valign="middle" bgcolor="#FFFFFF">
    <td width="100" height="20" align="right">上传文件:</td>
    <td height="20">
    <input type=radio name=picreload value='0' checked>不更新
    <input type=radio name=picreload value='1'>更新
    </td>
  </tr>
</table>
<br>
<div align="center">
  <input type="submit" name="post" value="  修 改  ">
    
  <input type="reset" name="Submit2" value="  还 原  ">
    
  <input type="button" onclick='javascript:history.back();' value="  返 回  ">
</div>
</form>
</body>
</html>

3.现将pagesuggestion.php代码粘贴如下:
<!--#INCLUDE FILE="../inc/Conndb.php"-->
<!--#INCLUDE FILE="../inc/Function.php"-->
<html>
<head>
<title>产品管理——产品推荐</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../products/attach.css" rel="stylesheet" type="text/css">
<SCRIPT language=JavaScript src="../inc/product.js"></SCRIPT>
<script language=javascript>
var newWindow = null
function windowOpener(loadpos)
{
    if (! newWindow || newWindow.closed)
    {
    newWindow = window.open(loadpos,"surveywin","scrollbars,dependent,width=400,height=420");
    }else
    {
    newWindow.focus();
    }
}
</script>

<?
//productid=request.QueryString("id")
//if
// $RsProduct is of type "ADODB.Recordset"

$sqlstr="select * from productcategory Order by categoryid";
mysql_query($RsProduct_CommandText,$RsProduct_ActiveConnection);$conn
if (!($RsProduct=0))
{

  $CategoryList=;
}


$RsProduct=null;

$quto="\"";
$br=char(13);
print "<SCRIPT language=JavaScript>".$br;
print "var categorypcount; ".$br;
print "var proudctcount;".$br;
print "var k;".$br;
print "categorypcount=0; ".$br;
print "productcount=0;".$br;
print "categoryp = new Array(); ".$br;
if (is_array($CategoryList))
{

  for ($i=0; $i<=count($CategoryList); $i=$i+1)
  {

    $categoryid=$CategoryList[0,$i];
    $categoryname=$CategoryList[2,$i];
    $categoryidp=$CategoryList[1,$i];
    print "categoryp[".$i."] = new Array(".$quto.$categoryid.$quto.",".$quto.$categoryname.$quto.",".$quto.$categoryidp.$quto."); ".$br;

  }

}

print "categorypcount =".$i.$br;
// $RsProduct is of type "ADODB.Recordset"

$sqlstr="select productid , productname , categoryid from product";
mysql_query($RsProduct_CommandText,$RsProduct_ActiveConnection);$conn
if (!($RsProduct==0))
{

  $ProductList=;
}


$RsProduct=null;

print "product= new Array(); ".$br;
if (is_array($ProductList))
{

  for ($j=0; $j<=count($ProductList); $j=$j+1)
  {

    $productid=$ProductList[0,$j];
    $productname=$ProductList[1,$j];
    $categoryid=$ProductList[2,$j];
    print "product[".$j."] = new Array(".$quto.$productid.$quto.",".$quto.$productname.$quto.",".$quto.$categoryid.$quto.");".$br;

  }

}

print "productcount =".$j.$br;

print "</SCRIPT>    ".$br;
?>

<link href="../livestyle.css" rel="stylesheet" type="text/css">

</head>

<body bgcolor="#FFFFFF">
<table width="80%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#000000">
  <tr>
    <td height="22" align="center" class="white-bold">产品推荐</td>
  </tr>
</table>
<form action="../products/pagesuggpro.php" method="post" name="form" id="form">
  <table width="80%" border="0" cellspacing="1" cellpadding="5" align="center" bgcolor="#000000">
    <tr bgcolor="#FFFFFF">
  <td width="20%" align="right" height="25">产品种类:</td>
  <td width="572" height="25">
  <? DrawCategoryidp($categorylist);?>
  (推荐产品所属的种类)</td>

    </tr>
    <tr bgcolor="#FFFFFF">
  <td width="20%" height="25" align="right">所属子类:</td>
  <td height="25"> <? DrawCategory();?>
    (推荐产品所属的子类)</td>
    </tr>
    <tr bgcolor="#FFFFFF">
  <td height="25" align="right">产品名称:</td>
  <td height="25"><select name="productname" size="1" id="productname">
    </select> </td>
    </tr>
    <tr bgcolor="#FFFFFF">
  <td width="20%" height="25"><div align="right">推荐位置:</div></td>
  <td height="25"><select name="relateposition" size="1" id="select5">
  <option value="1" selected>首页</option>
  <option value="2">产品展示页</option>
  <option value="3">产品详情页面</option>
    </select> </td>
    </tr>
    <tr bgcolor="#f5f5f5" align="center">
  <td height="40" colspan="2"> <input type="submit" name="Submit" value=" 提 交 ">
    <input type="submit" name="Submit2" value=" 重 选 "> </td>
    </tr>
    <tr bgcolor="#f5f5f5" align="center">
  <td height="22" colspan="2"><a href="../products/listrecommand.php" class="blue">返回推荐信息列表</a>
    >>></td>
    </tr>
  </table>
</form>
</body>
</html>
三个文件都在这里,请斑竹帮帮忙,在此谢谢啦!!!!
 3#楼  
 
  回复人:一起PHP
  注册时间:2004-02-27
  主题/回复:247/1521
  积分:4649
  等级:★★★★★☆(十一级)
  称号:论坛圣人

   
 3#楼 发表于2005-08-25 17:31:24  评分: 

文件比较长,而且既然在其他机器上运行完好的程序,代码肯定没问题,所以代码我没有仔细看。
考虑以下两台机器的差异,运行环境阿,系统阿之类的,还有数据库是否一致,还有你修改的部分再仔细核实一下,看看是否有问题。

把原来的原始程序直接运行一下,如果运行没问题,再修改,这样慢慢修改,查找问题。/
  页数1/1首页 « 1 » 末页
  发表回复:您还没有登陆,无法发表回复。请先[登陆]

一起PHP技术联盟 主办:一起PHP 联系方式:站长QQ:4304410 QQ群:8423742 20159565 站长博客 E-mail: nqp@nqp.me 执行时间:0.022sec
SimsmaBBS 2008 (v6.0) Developed by 17php.com,Copyright(C)2003-2010 All rights reserved. 副本授权:一起PHP官方专用版