if(isset($_REQUEST['sign_in'])) {
if(!empty($_REQUEST['email']) && !empty($_REQUEST['password'])) {
$sel = 'SELECT * FROM admin_login WHERE email="'.$_REQUEST["email"].'" AND password ="'.$_REQUEST["password"].'"';
$result = $conn->query($sel);
$data = mysqli_fetch_assoc($result);
session_start();
$_SESSION['user_id'] = $data['id'];
$_SESSION['user_name'] = $data['firstname'];
$_SESSION['user_email'] = $data['email'];
$_SESSION['user_image'] = $data['image'];
if(mysqli_num_rows($result)==1) {
header( 'location:http://localhost/prit/Dynamic/glance_design_dashboard/web/index.php');
} else {
$msg = 'Please Enter valid Email Or Password';
}
}
}
如何使用php获取图片?
<span class="prfil-img"><img src="images/<?php $_SESSION['user_image'];?>" alt=""> </span>
2条答案
按热度按时间zzoitvuj1#
您可以执行以下操作:
或:
r8uurelv2#
忘记在HTML代码中加入echo