I would like to display a php page (form.php) if the user enter a value found in a database. this page is in an include an set as display none in a span tag. If the user enter a correct value i woulk like to display it. i have a try to do it, but i need help.
<?php
if (!empty ($_POST['submit']) AND $_POST['submit'] == 'Verifier')
{
$numero = mysqli_real_escape_string($conn,$_POST['numero']);
$sql = "Select numero from transaction where numero='$numero' ";
$res = mysqli_query($conn, $sql);
if (mysqli_num_rows($res) != 0)
{
?>
<script type="text/javascript">
document.getElementById('trans').style.display=="block";
</script>
<?php
}
else
{
?>
<script type="text/javascript">
document.getElementById('trans').style.display=="none";
</script>
<?php
}
}
?>
<form action="inscription.php" method="post" >
<input type="text" name= "numero" required>
<input type="submit" value="Verifier" name="Verifier" />
</form>
<span id ="trans" style="display:none" >
<? php include('form.php'); ?>
</span>
If i use the wrong method to do it your help is appreciated.