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

PHP下include包含文件有关问题

WBOY
Release: 2016-06-13 12:31:54
Original
866 people have browsed it

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 />
	?>
Copy after login

运行截图:

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