Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/csharp-4.0/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 我应该如何在页面中显示图像?_Php - Fatal编程技术网

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'].'&nbsp;'.'</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'].'&nbsp;&nbsp;'.$rows['name'].'&nbsp;&nbsp;=&nbsp;&nbsp;'.$rows['votes'];

    } else {
        echo $rows['lastname'].'&nbsp;&nbsp;=&nbsp;&nbsp;'.$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'