i want to change value of 2nd input after submitting the value of first input but it's not happening. i want to print email in 2nd input value
<?php
$db = mysqli_connect('localhost','root','root','rahul');
if(isset($_POST['submit']))
{
$email = $_POST['email'];
$sql = mysqli_query($db,"select * from register where email='$email'");
if(mysqli_fetch_array($sql)==true)
{
echo '<input type="text" name="question" value="$email">'; /* 2nd input */
}
else
{
echo "no";
}
}
?>
<center><br><br>
<form action="" method="post" >
<input type="text" name="email"><br><br> /* first input*/
<input type="submit" name="submit">
</form>