求帮忙查错,谢谢

php中文网
发布: 2016-06-23 13:39:56
原创
1066人浏览过

各位好,我对PHP不太懂,在网上拉了一个项目,试用wampserver运行的时候,貌似有语法错误编译不通过。看了半天没看出来,烦劳各位帮个小忙,谢谢。

Parse error: parse error in E:\PHP\wamp\www\includes\db_mysql_error.php on line 132

<?php/*----------------------------------------------------	[dzsw] includes/db_mysql_error.php ----------------------------------------------------*/if(!defined('DIR_dzsw')) {    exit('Access Denied');}global $timestamp, $settings;$dberror = $this->error();$dberrno = $this->errno();if($dberrno == 1114) {?><html><head><style type="text/css">body{ 	scrollbar-base-color: #32679D; 	scrollbar-arrow-color: #C3D2E9; 	font-size: 12px; 	background-color: #FFB202;	margin: 6px;}table{ 	font-family: Tahoma, Verdana; 	color: #000000; 	font-size: 12px }.tableout{ 	background: #4277AD; 	border: 0px solid #7CA5DE;}.bgcolor1{	background-color : #FFFFFF;}</style><title>Max onlines reached</title></head><body leftmargin="6" topmargin="6"><table bgcolor="#FFFFFF" bordercolor="#FFFFFF" width="88%" cellpadding="1" cellspacing="6" border="1" align="center" height="100%"><tr>	<td height="100%">		<table cellpadding="4" cellspacing="1" border="0" width="500" align="center" class="tableout">		<tr class="bgcolor1">			<td>				<br>					<b style="font-size: 13px;">					Notice: WebShop onlines reached the upper limit.					</b>					<br>					<br>					<br>					Sorry, the number of online visitors has reached the upper limit.					<br>					Please wait for someone else going offline or visit us in idle hours.					<br>					<br>				</td>		</tr>		</table>	</td></tr></table></body></html><?	exit;} else {?><html><head><style type="text/css">body{ 	scrollbar-base-color: #32679D; 	scrollbar-arrow-color: #C3D2E9; 	font-size: 12px; 	background-color: #FFB202;	margin: 6px;}table{ 	font-family: Tahoma, Verdana; 	color: #000000; 	font-size: 12px }.tableout{ 	background: #4277AD; 	border: 0px solid #7CA5DE;}.bgcolor1{	background-color : #FFFFFF;}</style><title>Mysql error!</title></head><body leftmargin="6" topmargin="6"><table bgcolor="#FFFFFF" bordercolor="#FFFFFF" width="100%" cellpadding="1" cellspacing="6" border="1" align="center" height="100%"><tr>	<td height="100%">		<table cellpadding="4" cellspacing="1" border="0" width="500" align="center" class="tableout">		<tr class="bgcolor1">			<td>				<br><font style="font-size: 13px;">				<b>Time:</b> <?=gmdate("Y-n-j H:i:s", $timestamp + ($settings['time_offset'] * 3600))?><br><br>				<b>Script: </b> <?php echo $GLOBALS['_SERVER']['REQUEST_URI'];?><br><br>				<?if($sql){?>					<b>SQL: </b> <?=htmlspecialchars($sql)?><br><br>				<?}?>				<b>Error: </b> <?=$dberror?><br><br>				<b>Errno: </b> <?=$dberrno?><br><br>				</font><br>			</td>		</tr>		</table>	</td></tr></table></body></html><?	exit;}?>
登录后复制

貌似是在倒数第三行的花括号这,我把括号去掉了也不对。。

AI帮个忙
AI帮个忙

多功能AI小工具,帮你快速生成周报、日报、邮、简历等

AI帮个忙 55
查看详情 AI帮个忙

回复讨论(解决方案)

先把中间html的部分去掉看看是否还有报错。
如果去掉没有报错,就在html那部分找原因。

一个可能的原因是你的PHP没有开启短标签功能(  short tags)

看者挺怪的

两个html, 有公共的头部 尾部等,可以写一个的,只是输出显示不一样罢了
另外,写if else语句看的也很怪



xxxxx



xxxxx




exit可以考虑不用,在这里没什么大用

129 行的 
改为 

129 行的 
改为 
改了也没用啊

129 行的 
改为 

<?php/*----------------------------------------------------	[dzsw] includes/db_mysql_error.php ----------------------------------------------------*/if(!defined('DIR_dzsw')) {    exit('Access Denied');}global $timestamp, $settings;$dberror = $this->error();$dberrno = $this->errno();if($dberrno == 1114) {?><html><head><style type="text/css">body{ 	scrollbar-base-color: #32679D; 	scrollbar-arrow-color: #C3D2E9; 	font-size: 12px; 	background-color: #FFB202;	margin: 6px;}table{ 	font-family: Tahoma, Verdana; 	color: #000000; 	font-size: 12px }.tableout{ 	background: #4277AD; 	border: 0px solid #7CA5DE;}.bgcolor1{	background-color : #FFFFFF;}</style><title>Max onlines reached</title></head><body leftmargin="6" topmargin="6"><table bgcolor="#FFFFFF" bordercolor="#FFFFFF" width="88%" cellpadding="1" cellspacing="6" border="1" align="center" height="100%"><tr>	<td height="100%">		<table cellpadding="4" cellspacing="1" border="0" width="500" align="center" class="tableout">		<tr class="bgcolor1">			<td>				<br>					<b style="font-size: 13px;">					Notice: WebShop onlines reached the upper limit.					</b>					<br>					<br>					<br>					Sorry, the number of online visitors has reached the upper limit.					<br>					Please wait for someone else going offline or visit us in idle hours.					<br>					<br>				</td>		</tr>		</table>	</td></tr></table></body></html><?php	exit;} else {?><html><head><style type="text/css">body{ 	scrollbar-base-color: #32679D; 	scrollbar-arrow-color: #C3D2E9; 	font-size: 12px; 	background-color: #FFB202;	margin: 6px;}table{ 	font-family: Tahoma, Verdana; 	color: #000000; 	font-size: 12px }.tableout{ 	background: #4277AD; 	border: 0px solid #7CA5DE;}.bgcolor1{	background-color : #FFFFFF;}</style><title>Mysql error!</title></head><body leftmargin="6" topmargin="6"><table bgcolor="#FFFFFF" bordercolor="#FFFFFF" width="100%" cellpadding="1" cellspacing="6" border="1" align="center" height="100%"><tr>	<td height="100%">		<table cellpadding="4" cellspacing="1" border="0" width="500" align="center" class="tableout">		<tr class="bgcolor1">			<td>				<br><font style="font-size: 13px;">				<b>Time:</b> <?php =gmdate("Y-n-j H:i:s", $timestamp + ($settings['time_offset'] * 3600))?><br><br>				<b>Script: </b> <?php echo $GLOBALS['_SERVER']['REQUEST_URI'];?><br><br>				<?php if($sql){ ?>					<b>SQL: </b> <?php =htmlspecialchars($sql)?><br><br>				<?php } ?>				<b>Error: </b> <?php =$dberror?><br><br>				<b>Errno: </b> <?php =$dberrno?><br><br>				</font><br>			</td>		</tr>		</table>	</td></tr></table></body></html>
登录后复制

我现在把后面的exit删掉了,报Parse error: parse error in E:\PHP\wamp\www\includes\db_mysql_error.php on line 113

把短标签改成完整标签之后,之前所有的= $aaaa  都应该替换为   

解决了 谢谢各位

最佳 Windows 性能的顶级免费优化软件
最佳 Windows 性能的顶级免费优化软件

每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。

下载
来源:php中文网
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
开源免费商场系统广告
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号