Home > Backend Development > PHP Tutorial > 升级WAMPSERVER后运行php程序总报错,求助!

升级WAMPSERVER后运行php程序总报错,求助!

WBOY
Release: 2016-06-23 14:03:45
Original
866 people have browsed it

将WAMPSERVER升级到2.2(Apache 2.4.2; PHP 5.4.3; MySql 5.5.24)后运行php程序,总是报错,不知如何解决,求诸位指点。多谢

测试用源码如下:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>Window I</title></head><body><form id="inquery" method ="post" action="window2.php" ><h2>Window I</h2><table >	<tr>    	<td colspan="3"><b>General Information</b></td>    </tr>	<tr>    	<td width="144"> </td>    </tr>	<tr>    	<td><p>Item Name:</p></td>		<td> <?phpinclude("include/connect.php");//query string to ask the database$sqlString = "SELECT item_name FROM $table_name1"; // ask the query from the database$result = @mysql_query($sqlString,$connection) or die("Error: 003. Couldn't connect to table - Please try later"); ?><select name="item_name" value ="<?php echo $item_name; ?>"><option>--- Please Select ---</option><?php while($row = @mysql_fetch_array($result)) 	{ ?> 		<option><?php echo $row['item_name'] ?></option> <?php } ?> <?php 		echo "\$itemname = $itemname<br><br>";?> </select>     	</td>	</tr>	<tr>    	<td width="144"> </td>    </tr>	</table><table>  	<tr>  		<td><input id="submit" class="submit" name="submit" type="submit" value="Inquery"/></td>  	</tr> </table></form>	</body></html>
Copy after login



错误截屏如下:


回复讨论(解决方案)

31行 $item_name 变量没有定义
38行 $itemname 变量没有定义

那是因为之前的php的notice被你屏蔽了,升级后,配置又恢复了默认吧,所以notice又开启了

你的变量没定义  
如果原来正常  有可能是打开了 register globals   

php.ini

error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT

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