Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 327075
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T09:22:06+00:00 2026-05-12T09:22:06+00:00

I am relatively new to PHP, so my apologies if the answer is trivial.

  • 0

I am relatively new to PHP, so my apologies if the answer is trivial. Lol

I wrote a simple Contact Us email form (actually a WordPress page-template file). All the code is in one file.

After the user submits the form and the email is sent, the file generates a Thank You message.

If the user reloads the Thank You page, they are prompted to “Resend the Form Data,” which is why I am asking this question.

My question: How do I avoid the prompt to resend the form data and still keep all of my code (including the Thank You data) in one file?

EDIT: I’ve seen folks use headers( Location: ), but I don’t think that will work for if I want to keep all my code in one file.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T09:22:06+00:00Added an answer on May 12, 2026 at 9:22 am

    You could redirect to a different query.

    header("Location: ?page=thankyou");
    

    Then, you don’t even need to check if the POST data was sent. Just display the thank you page if page is equal to thank you.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am relatively new to programming with PHP. I have created a simple Javascript
I am relatively new to PHP, but experienced Java programmer in complex enterprise environments
This may be a silly question, but as someone relatively new to PHP, I'm
Note: I'm relatively new to Objective-C and am coming from Java and PHP. Could
Relatively new to rails and trying to model a very simple family tree with
Im relatively new to PHP but have realized it is a powerfull tool. So
i'm relatively new to php and mysql and would like to know how to
I am relatively new to php and have a feeling that I am going
I am relatively new to MySQL and PHP and I have been trying to
I am relatively new to Javascript so I'm hoping this is a simple mistake.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.