<?php
header("Access-Control-Allow-Origin: *");
$con = mysqli_connect("localhost","root","0123456zp");
if(! $con )
{
die(": " . mysqli_error($con));
}
mysqli_select_db($con,"xsmf");
$sql = "select * FROM user where name = "$_POST[name]" and pwd="$_POST[pwd]"";
$result = mysqli_query($con,$sql );
$rows=mysqli_num_rows($result);
if($rows){
session_start();
$_SESSION["name"] = $_POST[name];
$_SESSION["pwd"] = $_POST[pwd];
$_SESSION["wm"]=$rows["wm"];
echo "<script>window.location.href="../update.php"</script>";
exit;
}else{
echo "
<script>
window.location.href="../login.php";
alert("");
</script>";
}
mysqli_close($con)
?>
create table user
(
id int auto_increment primary key,
name varchar(30) unique not null,
pwd varchar(30) not null,
wm varchear(30) not null
);
the above is the background code and database code. I want to transfer the corresponding screen name (netname) to the main page after successful login verification. How to get this value? ask for advice and help to modify it. Thank you
.