Monday, June 17, 2019

html - how to redirect a page using php


define('DB_PASS' ,'');
define('DB_NAME', 'codexworld');
$con = mysqli_connect(DB_SERVER,DB_USER,DB_PASS,DB_NAME);
if(isset($_POST['submit'])){

$username=$_POST['username'];
$email=$_POST['email'];
$subject=$_POST['subject'];
$message=$_POST['message'];
$q=mysqli_query($con,"insert into demo (username,email,subject,message)values('$username','$email','$subject','$message')");
if ($q){
echo 'Not Inserted';
} else {
echo 'Inserted Successfully';
header('Location: ib.php');

}
}
?>



Simple Contact form in PHP & MySQL








Contact Us

























the above code connects to database and saves form data in database and it is supposed to redirect
the form data gets stored in data base but it doesn't redirect.
How can i solve this?Save the form data and redirect

No comments:

Post a Comment

plot explanation - Why did Peaches' mom hang on the tree? - Movies & TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...