我在xamarin pcl项目中创建了一个html文件。单击<?php
session_start();
$db =mysqli_connect("localhost", "root", "","registration" );
if (isset($_POST['login_btn'])){
$username = mysql_real_escape_string($_POST ['username']);
$password = mysql_real_escape_string($_POST ['password']);
$password= md5($password);
$sql = "SELECT * FROM users WHERE username= '$username' AND password= '$password'";
$result = mysqli_query($db, $sql);
if(mysqli_num_rows($result) == 1 ){
$_SESSION['message']= "You are now logged in";
$_SESSION['username'] = $username;
header("Location: home.php");
}else{
$_SESSION['message'] = "Username and password combination is incorrect";
}
}
?>
<html>
<head>
</head>
<body>
<div class="header"> <h1>login</h1></div>
<?php
if (isset($_SESSION['message'])){
echo "<div id = 'error_msg>".$_SESSION['message']."</div>";
unset($_SESSION['message']);
}
?>
<form method="post" name="loginform" action="login.php">
<table>
<tr>
<td> Username:</td>
<td><input type = "text" name="username" placeholder="Username" class="textInput" required></td>
</tr>
<tr>
<td> Password:</td>
<td><input type = "password" placeholder="Password" name="password" class="textInput" required></td>
</tr>
<tr>
<td></td>
<td><input type = "submit" name="login_btn" value="Login"></td>
</tr>
</table>
</form>
</body>
</html>
按钮时,我想读取文件并将其显示为带有xamarin.form
中图像的电子邮件正文。我该如何实现?
sent email