You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
695 B

3 years ago
<?php
header('Content-Type: text/html; charset=UTF-8');
?>
<?php
header('Content-type: image/jpg'); //输出HTTP头信息
require "fun.php";
//以GET方法从studentManage.php页面img控件的src属性中获取学生姓名值
$StuXm = $_GET['studentname'];
$sql = "select ZP from XS where XM ='$StuXm'"; //根据姓名查找照片
$result = $db->query(iconv('UTF-8', 'UTF-8', $sql));
//$result = mysql_query($sql);
list($ZP) = $result->fetch(PDO::FETCH_NUM);
//$row = mysql_fetch_array($result);
$image = base64_decode($ZP); //使用base64_decode()函数解码
//$image = base64_decode($row['ZP']); //使用base64_decode()函数解码
echo $image; //输出照片
?>