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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T23:05:32+00:00 2026-05-20T23:05:32+00:00

In my days of writing web applications, I’m missing a simple way for a

  • 0

In my days of writing web applications, I’m missing a simple way for a PHP script to direct to another PHP script while passing along data without using the URL

Browsers can pass data invisibly to a PHP script using the $_POST array. So I’m devising a script that will dump the contents of $_SESSION[“POST”] into the $_POST array to mimic the passing of post data, then clears $_SESSION[“POST”].

For instance, a page X contains a login form. Page X directs to page Y to validate the data. Page Y discovers that the login information is incorrect, and redirects back to page X – which now displays the error message “Login information incorrect” from $_POST.

Am I crazy for missing this feature? Is there some other method of doing this easily that I’m missing?

Please respond with anything that can be helpful.

  • 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-20T23:05:32+00:00Added an answer on May 20, 2026 at 11:05 pm

    You could use the session. On page X, you’d put the data into the session. On page Y, you’d validate the data and handle the redirect. You can put your error message into the session too.

    The session persists between requests, so it’s the perfect place to store that kind of data.

    EDIT

    OK, I’d do things with session variables, but if you want to avoid that you do have a few other options I can think of besides posting:

    1. You can use files on the server (such as temporary files). Use the user’s session key to identify which file is theirs, and you can read and write whatever data you care to it.
    2. You can put the data in a database. That would work too.

    Of course neither of those is a true post. If you want a true post, you have another two options.

    1. First, you can return the data to the page in a hidden form, and use JavaScript to trigger a POST. This is simple to do, but it requires the data to pass through the browser. This means you’d have to take care that a user didn’t change the data, and the user would have to have JavaScript on. You can checksum the data to ensure it isn’t modified, but the JavaScript problem is unsolvable.

    2. Another way to do it would be to take the user out of the equation entirely. When the user submits to page A, page A could make a POST to page B, check the response, and then redirect the user to the proper place. This would be just like if you had to make a JSON or SOAP call to a 3rd party service, except you control that service. It’s been a little while, but I believe that HttpRequest is the class to use to do this.

    It would be ideal if that URL you check with returns a simple answer (“true”, “false”, “yes”, “no”, “good”, “bad”, whatever), but as long as you can tell by the response whether they were successful or not, you can do it.

    Now I should note that I’d agree with mvds, this sounds like a function that should be included in page A so that it can do all the work but the code can be shared with other pages. Having page A post to page B and then redirect to A or C seems unnecessarily complex. Page A can easily accomplish all this. I read your comment on his answer, but it seems there should be another way to accomplish this.

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

Sidebar

Related Questions

I have a question in my mind from last many days, that while writing
I've been experiencing a strange issue the last couple of days while writing a
In my later days of writing jQuery as raw as possible, and not having
I have been writing software for several decades now and these days everything is
I have been writing this Android application for the past few days and everything
When I was writing C# code a few days ago I noticed that the
I spend my days in vim, currently writing a lot of JavaScript. I've been
For my current job I am writing some long-running (think hours to days) scripts
You may have noticed that certain web applications (for example, certain parts of GMail)
In the next couple of days I have to start writing some report generation

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.