Php 我应该如何在页面中显示图像?
我应该在哪里放置一个使图像能够显示,以及应该插入什么代码我的意思是如何放置一些(Php 我应该如何在页面中显示图像?,php,Php,我应该在哪里放置一个使图像能够显示,以及应该插入什么代码我的意思是如何放置一些('admin/savephp/images/),因为这是放置图像的地方 <?php include('../connect.php'); $result = $db->prepare("SELECT * FROM candposition ORDER BY posid ASC"); $result->bindParam(':userid', $res); $resul
'admin/savephp/images/)
,因为这是放置图像的地方
<?php
include('../connect.php');
$result = $db->prepare("SELECT * FROM candposition ORDER BY posid ASC");
$result->bindParam(':userid', $res);
$result->execute();
for($i=0; $row = $result->fetch(); $i++){
$dsds=$row['posid'];
$resulta = $db->prepare("SELECT sum(votes) FROM candidates WHERE posid= :a");
$resulta->bindParam(':a', $dsds);
$resulta->execute();
for($i=0; $rowa = $resulta->fetch(); $i++){
$dsada=$rowa['sum(votes)'];
}
echo '<div style="margin-top: 18px;">';
echo '<strong>'.$row['pos_name'].' '.'</strong><br>';
$results = $db->prepare("SELECT * FROM candidates,users WHERE candidates.idno=users.idno AND posid= :a ORDER BY votes DESC");
$results->bindParam(':a', $dsds);
$results->execute();
for($i=0; $rows = $results->fetch(); $i++){
if($dsds=='Commissoner'){
echo $rows['course'].' '.$rows['name'].' = '.$rows['votes'];
} else {
echo $rows['lastname'].' = '.$rows['votes'];
}
$sdsd=$dsada
?>
<img src="../img/percent.gif"width='<?php echo(100*round($rows['votes']/($sdsd),2)); ?>'height='10'>
<?php
echo(100*round($rows['votes']/($sdsd),2));
?>
%<br>
<?php
}
}
?>
您可以在任何需要图像的地方执行此操作
echo '<img src="admin/savephp/images/'.$rows['image'].'" \>';
echo';
嗯?这不清楚你在问什么…很抱歉,问题是我应该如何将图像放入php?谢谢你,它可以工作感谢你的时间上帝保佑:)但是如果我想为图像设置高度和宽度,如何插入?你可以使用带有id属性或类的Css,我会推荐,或者这样做echo'