Home > Backend Development > PHP Tutorial > php不执行的怪异有关问题

php不执行的怪异有关问题

WBOY
Release: 2016-06-13 12:58:46
Original
1251 people have browsed it

php不执行的怪异问题
一个html和php结合的页面,本机运行正常,传到空间就不能执行,其他php页面可以正常显示,经过测试我发现里面有require_once语句就无法执行,换成include可以执行通过了,但是到了创建类的时候又不执行了,echo语句放到$q_Servie = new q_Service ();前面可以执行,放到后面就不执行。index_Service.class.php文件里面也调用类,也是相对路径(  include('/database/sqlhelper.class.php');),不知道有没有关系。本机wamp,mysql5.5,php5.4,空间的数据库是5.0的,请帮忙看看怎么回事。

<br />
<br />
<div id="bodyright"><br />
<br />
<?php<br />
include("/member/index_Service.class.php");<br />
$pagenow=0;<br />
$pagesize=24;<br />
<br />
$q_Servie = new q_Service ();<br />
<br />
$res=$q_Servie->get_quan_list($pagenow, $pagesize);<br />
for($i = 0; $i < count ( $res); $i ++) {<br />
	$row = $res [$i];<br />
	$photo = "upload_file/{$row['q_creator']}/{$row['q_photo']}";<br />
	$q_secrecy = $row ['q_secrecy'];<br />
	if ($row ['q_photo'] == "") {<br />
		$photo = "upload_file/quan.png";<br />
	}<br />
		echo " <div class='fieldset'><form action='content.php' method='post' ff={$row['q_id']}><br />
<div class='legend' > [{$row['q_id']}]<h7>{$row['q_name']}</h7></div><br />
<div class='div-t'><img  class='tx' src='$photo'/ alt=" php不执行的怪异有关问题 " ><p class='p-about'>{$row['q_about']}</p></div><br />
<div class='db'><img   class='ys' src='img/member.png'   style="max-width:90%" title='网站注册会员可用'/ alt=" php不执行的怪异有关问题 " ><input type='hidden' name='q_id' value={$row['q_id']} /><br />
<input type='button' class='jr' q_id={$row['q_id']} value='申请加入' /> <input id={$row['q_id']}  q_secrecy=$q_secrecy type='button' value='进入' class='bt' /> </div><br />
</form></div>";<br />
<br />
}<br />
<br />
?><br />
</div><br />
Copy after login

------解决方案--------------------
include('/database/sqlhelper.class.php');
include("/member/index_Service.class.php");
都是绝对路径,加载不了是正常的
能加载才是错误的
------解决方案--------------------
尽量不要php代码和html代码混编了。一般都用smarty模板来搞了。

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template