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

  • Home
  • SEARCH
  • 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 4610492
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T01:08:20+00:00 2026-05-22T01:08:20+00:00

As the title says, is there another way to pass a variable from "current"

  • 0

As the title says, is there another way to pass a variable from "current" page over to "next" (new HTTP request) page without using sessions/cookies/$_GET?

Well, I guess $_POST could be an option too, but the thing here is, that I want to pass this variable from already executed $_POST back to off-the-post environment page, but inbetween I’m having a redirect, to disallow reposting the same form.

In other words, basicly, I’m trying to "make" a seamless PRG, but sessions/cookies/$_GET is not an option.

And yes, I’m working with classes (hence the oop tag). Therefore maybe some kind of magic functions, or output control?

This has to work within PHP environment, no JavaScript or other non server side language.

I also have a bad feeling that it’s impossible, but hopefully I’m wrong, and there is a solution.

Thanks in advance!

update no. 1

Basicly, I want to create a PRG with response.

Inside this $_POST I’m adding data to database. I want this response to hold information whether this database query has been successful or not. Kind of make this $_POST process almost invisible to the user. And yes, display a response with the result later on.

All of this happens in one method:

if($_POST){
    // insertion
}else{
    // display no-post environment, if response exists (therefore posted) display response too
}

Something like that…

Sessions is not an option because this is meant to be some kind of API.

update no. 2

Huh, let me rephrase the question a little. Well, it seems that I don’t actually need to pass the variable over. What I want to do, is to have 2 different results after POST so on next page load I could know whether the actions in POST has been successful or not. So, what other options are out there without using sessions/cookies/$_GET to get this result?

Currently there is:

  • temporary database usage: a good option, but I’d like to see different options;
  • 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-22T01:08:21+00:00Added an answer on May 22, 2026 at 1:08 am

    Since you’re already using a database it seems like the easiest way to handle this would be to update some kind of temporary table with the information you want based on the post call, then on the page you’re doing a header redirect to, read the information in that table. With the constraints you’ve placed on this (no GET, SESSION, Cookie or Javascript) you’re not going to be able to maintain a variable when you redirect from one page to the next.

    So leverage that database and take the work off of PHP. Initially I was going to suggest utilizing cURL but I don’t think that will help here (though you may want to look it up if you’re unfamiliar with it, as it might be what you’re looking for)

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

Sidebar

Related Questions

As the title says, is there a way to remove code from a view
As the title says, is there a way to check for an empty collection
So, just like the title says, I need to create an application that gets
as the title says, I want to make a tab interface where I have
Like the title says - say I have a text field turned into a
As the title says. Nothing goes wrong immediately if I do this: - (void)
as the title says , i am trying to add a data source and
As the title says, I have an UncaughtExceptionHandler set in my custom application class
Hi there i'm playing with stmt for the first time (looking at converting my
The html5 spec says that: The outline for a sectioning content element or a

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.