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 9106571
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T02:22:09+00:00 2026-06-17T02:22:09+00:00

I have been doing this for a while now, but still get confused when

  • 0

I have been doing this for a while now, but still get confused when it comes to PRG. I know how it works so for example I would do:

if($_POST){
 header("Location: ".$_SERVER['REQUEST_URI']);
 exit();

}

Because it stops user refreshing and sending the POST to the server again. But I keep getting the “Warning: Cannot modify header information – headers already sent” blah blah message. I know this is because the redirect needs to go before any whitespace or echo-ing or text etc… so right above the header would be ideal!

But if my form is sent to a random .php page with no header or anything (where I can process data and edit database etc), this makes more sense to me – but this way I can’t include any of the WordPress functionality to process my data and do what I need to do. Like I would include a few lines of WordPress to allow me to access the functions, but this way I cant process the data and THEN redirect the user.

At the moment to get round this I am processing data and using a meta-refresh to redirect, and I know this is BAD!

Hope this makes sense 🙂 Any help would be really appreciated!

  • 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-06-17T02:22:10+00:00Added an answer on June 17, 2026 at 2:22 am

    im not sure what is the right way to do this

    but usually i use js redirect echo '<script>window.location="somefile.php";</script>';
    to avoid this error

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

Sidebar

Related Questions

I have been scratching my head on this for a while now but still
Still learning JSP Web Applications here. I have been doing this for a while
I have been trying to get this code to work for a while now
Its been a while now and im still trying to get a certain code
This thing has been doing my head in for a little while now and
I have been searching for quite a while now but i am unable to
I have been doing Rails for a while now and just started to dive
I've been using CtrlP for a while now, but I still haven't figured out
I have been looking at this forum on this topic for a while now
I have been doing WordPress themes for a while, but the straight forward ones.

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.