This is my first webpage in php.I have created a log in page.I have successfully logged in.I need to redirect the webpage to the user's profile with a message of welcome user. how to do it? This is my code where should i add the redirect code? thank you in advance
<?php
$servername="localhost";
$username="root";
$password="";
$dbname="userdetails";
$conn=mysqli_connect($servername,$username,$password,$dbname);
if(!$conn){
die("connection failed".mysqli_connect_error());
}
?>
<?php
$username=$_POST['username'];
$password=$_POST['password'];
$qry = "select * from userdetails where username='$username' AND password='$password'";
$LoginName="";
$result=$conn->query($qry);
if($result->num_rows>0){
while($loginuser=$result->fetch_assoc())
{
$LoginName=$loginuser['username'];
}
}
?>