<?php
require '../Smarty/libs/Smarty.class.php';
$smarty=new Smarty;
$smarty->compile_check=true;
$smarty->debugging=true;
$link=mysql_connect("localhost","admin","admin")or die("数据库连接失败".mysql_error());
mysql_query("set names 'utf8'",$link);
mysql_select_db("xiangmu",$link);
$sql=mysql_query("select picturebath from picture_information ");//获取图片路径
while ($content=mysql_fetch_array($sql)) {
//echo "<tr>";
/*for($i=0;$i<count($content)/2;$i++)
echo "<td>".htmlspecialchars(($content[$i]))."</td>"."<br>";
echo "</tr>";*/
for($i=0;$i<count($content)/2;$i++)
$specialchars=htmlspecialchars(($content[$i]));
echo "<td>"."<a>"."<img src=".$specialchars."/>"."</a>"."</td>";//显示图片
}
?>
require '../Smarty/libs/Smarty.class.php';
$smarty=new Smarty;
$smarty->compile_check=true;
$smarty->debugging=true;
$link=mysql_connect("localhost","admin","admin")or die("数据库连接失败".mysql_error());
mysql_query("set names 'utf8'",$link);
mysql_select_db("xiangmu",$link);
$sql=mysql_query("select picturebath from picture_information ");//获取图片路径
while ($content=mysql_fetch_array($sql)) {
//echo "<tr>";
/*for($i=0;$i<count($content)/2;$i++)
echo "<td>".htmlspecialchars(($content[$i]))."</td>"."<br>";
echo "</tr>";*/
for($i=0;$i<count($content)/2;$i++)
$specialchars=htmlspecialchars(($content[$i]));
echo "<td>"."<a>"."<img src=".$specialchars."/>"."</a>"."</td>";//显示图片
}
?>
$specialchars是图片路径,显示出来
echo $specialchars;
看看到底是什么,为什么不能当路径使用
echo "发放10分!";}else{
echo "鸭蛋!";
}