-1

I have the following php code that has worked great. However, instead of after submitting the form and displaying "Thank you" on a page, I want it to be redirected to another page that i have designed beautifully. The page is labelled as thankyou.html.

Here is my php code

enter image description here

Please where do I place the code for redirection to thankyou.html page? Thanks Zollyzo

  • 1
    can you paste te code in the image in your question? – CIRCLE Feb 13 '17 at 12:25
  • Just a suggestion, you've got MySQL usernames/passwords in your screenshot as well as an open tab to a MySQL database with the URL in the title, you might want to replace out the login details (if they are the correct ones) – James Hunt Feb 13 '17 at 12:27

2 Answers2

1

The redirect code is header("location:thankyou.html");

If the insert query is executed, the page redirects to thankyou.html

if(mysqli_query($link,$sql))
{
    header("location:thankyou.html");
}
affaz
  • 1,191
  • 9
  • 23
0

use

header('Location: thankyou.html') or echo '<script>window.location.href = "thankyou.html"</script>';

in your if statement, you can use session to store temporary success message if you want to show some message after redirection

Divyank
  • 740
  • 3
  • 20