Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/76.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_Html - Fatal编程技术网

在PHP网页上查看图像

在PHP网页上查看图像,php,html,Php,Html,我想在我的PHP网页上查看图像。有没有办法在php页面上查看图像 这是我的密码 <?php $connection = mysql_connect("localhost", "", ""); // Establishing Connection with Server $db = mysql_select_db("wikkolk_wikko", $connection); // Selecting Database from $name1 = $_GET['name']; $sql

我想在我的
PHP
网页上查看图像。有没有办法在php页面上查看图像

这是我的密码

<?php
$connection = mysql_connect("localhost", "", "");  // Establishing Connection with Server
$db = mysql_select_db("wikkolk_wikko", $connection); // Selecting Database from 

$name1 = $_GET['name'];
$sql = "select * from asd where ccc like '$name1%'";
$result = mysql_query($sql);

while ($row = mysql_fetch_array($result, MYSQL_NUM)) {
   printf("ID: %s  Name: %s", $row[0], $row[1]); 
   ?>
   <img src=$row[5]/>
   <?php 
   echo "<br>";
}
mysql_free_result($result);
?>

尝试将while循环写为:

<?php
while ($row = mysql_fetch_array($result, MYSQL_NUM)) {
    printf("ID: %s  Name: %s", $row[0], $row[1]); 
    echo '<img src="'.$row[5].'" alt="image"/>';
    echo "<br>";
}
?>

尝试使用
“/>
需要进行html转义。名称中包含
的文件或文件夹将破坏它(这在NTFS和ext4中是合法的)
echo'