Home >Backend Development >PHP Tutorial > PHP下include包含文件有关问题

PHP下include包含文件有关问题

WBOY
WBOYOriginal
2016-06-13 12:31:54868browse

PHP下include包含文件问题
我的代码:

<?php<br />
		require("header.inc.php");<br />
<br />
		function __autoload($className)<br />
		{<br />
			include $className."__class.php";<br />
		}<br />
<br />
		$DbModle=new ProductModle();<br />
		$allProduct=$DbModle->selectAllProduct();<br />
		if($allProduct)<br />
		{<br />
			echo '<table align="center" width="90%" border="1">';<br />
			echo '<caption>商品列表</caption>';<br />
			echo '<th>产品ID</th><th>名称</th><th>价格</th><th>编辑</th>';<br />
			foreach($allProduct as $product)<br />
			{<br />
				echo '<tr>';<br />
				echo '<td>'.$product->getId().'</td>';<br />
				echo '<td>'.$product->getName().'</td>';<br />
				echo '<td>'.$product->getPrice().'</td>';<br />
				echo '<td>';<br />
				echo '<a href="editview.php?action=modify&productID='.$product->getId().'">修改</a>';<br />
				echo '<a href="control.php?action=delete&productID='.$product->getId().'">删除</a>';<br />
				echo '</td></tr>';<br />
			}<br />
			echo '</table>';<br />
		}<br />
		else<br />
		{<br />
			echo '<p align="center">没有任何商品</p>';<br />
		}<br />
		echo '<center><a href="editview.php?action=add">添加商品</a></center>';<br />
		require("footer.inc.php");<br />
	?>

运行截图:

Statement:
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
Previous article: PHP 5.5.6 公布 Next article: mysqli->fetch_assoc有关问题