In php page redirect is very simple. After submit data into database you can redirect in the another page using header() in php. Set header location in header function, like that
header(“location:view.php”);
For Example:
<?php $sql=mysqli_query($con,"INSERT INTO `table name`(`field 1`,`field 2`)VALUES('$variable1','$variable2')"); if($sql){ header("location:view.php"); } ?>
if you want to set location in the script and echo the location. For example –
<?php $sql=mysqli_query($con,"INSERT INTO `table name`(`field 1`,`field 2`)VALUES('$variable1','$variable2')"); if($sql){ echo "<script>window.location.href='view.php'</script>"; } ?>
Question and answer is powered by AnsPress.io