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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T03:19:29+00:00 2026-05-14T03:19:29+00:00

Hello, I’m looking for advise on how to share certain bits of data (i.e.

  • 0

Hello,
I’m looking for advise on how to share certain bits of data (i.e. post-submit confirmation messages) between individual requests in a web application. Let me explain:

Current approach:

  1. user submits an add/edit form for a resource
  2. if there were no errors, user is shown a confirmation with links to:
    • submit a new resource (for “add” form)
    • view the submitted/edited resource
    • view all resources (one step above in hierarchy)
  3. user then has to click on one of the three links to proceed (i.e. to the page “above”)

Progmatically, the form and its confirmation page are one set of classes. The page above that is another. They can technically share code, but at the moment they are both independent during processing of individual requests.

We would like to amend the above as follows:

  1. user submits an add/edit form for a resource
  2. if there were no errors, the user is redirected to the page with all resources (one step above in hierarchy) with one or more confirmation messages displayed at the top of the page (i.e. success message, to whom was the request assigned, etc)

This will:

  1. save users one click (they have to go through a lot of these add/edit forms)
  2. the post-submit redirect will address common problems with browser refresh / back-buttons

What approach would you recommend for sharing data needed for the confirmation messages between the two requests, please?

I’m not sure if it helps, it’s a PHP application backed by a RESTful API, but I think that this is a language-agnostic question.

A few simple solutions that come to mind are to share the data via cookies or in the session, this however breaks statelessness and would pose a significant problem for users who work in several tabs (the data could clash together). Passing the data as GET parameters is not suitable as we are talking about several messages which are dynamic (e.g. changing actors, dates).

Thanks,
M.

  • 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-14T03:19:29+00:00Added an answer on May 14, 2026 at 3:19 am

    ASP.NET

    Since the question is presented as language agnostic, you might be interested in ASP.NET’s Server.Transfer which does exactly what you want to achieve.


    PHP

    However for PHP, the situation doesn’t seem to be very easy and all solutions that come into my mind have design smells:

    Sessions

    Using sessions to mark your data with certain flags and then check and use them on overview page. You just have to be sure you always unset these data after you don’t need them anymore, which might be tricky.

    Database

    Queue those data in database as confusedGeek described in his post, but I don’t think it’s a good idea to query every single request like this. It’s going to be quite many requests on DB server if you application is bit bigger, which might slow things down.

    cURL

    Taking advantage of cURL in PHP, if you have the chance:

    <?php
    $curl = curl_init( );
    
    curl_setopt( $curl, CURLOPT_URL, "http://localhost/something.php" );
    curl_setopt( $curl, CURLOPT_POST, true );
    curl_setopt( $curl, CURLOPT_POSTFIELDS, $_POST );
    
    curl_exec( $curl );
    curl_close( $curl );
    ?>
    
    <form action="test.php" method="post">
        <input id="textfield" name="textfield" />
        <input type="submit" />
    </form>
    

    This piece of code takes something.php on server side, allows to send POST data to it and shows you its content (which could be just print_r( $POST ); in this example). This one could do what you need, but it has once again one flaw – the URL won’t change, so users might get confused – and I wouldn’t really recommend it.


    I personally think your case might be a design flaw. Why would you want to take all resources from form page and move them to other? Isn’t easier to work with your data in a file / class designed for it and then just decide what outcome you have? If something fails, it returns the user on page with form and if everything went well, you post the data to DB and show overview page with some happy message that everything went okay.

    If you really want to proceed with the way of sending everything to other page, using AJAX/AJAJ could be another solution for you.

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

Sidebar

Related Questions

Hello I am placing a external .swf into my .fla on a certain window
Hello guys that is not normal :) !! foo.php <?php if (isset($_POST['data'])) $stringData =
Hello I am creating an application where I can store data in a Hashmap
Hello, I want to put custom status bar in notification window of iphone. is
Hello I did login as a super admin in the front en of joomla
Hello! I've been programming for a long time but just started developing for android,
Hello all I am working on javascript jquery and svg.I want to ask a
Hello all I am working on html and javascript.And I am going to ask
Hello ! I need to create a report like the attachment shows with Jasper
Hello I have like this 2 tables class User public int UserId{get;set;} { ....

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.