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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T04:39:42+00:00 2026-05-18T04:39:42+00:00

This is a very difficult problem to describe. The big picture: An ajaxed dialog

  • 0

This is a very difficult problem to describe.

The big picture:
An ajaxed dialog submits to a page to create a new Content Set record. After creation of the Content Set record, this newly created Content Set should be the selected content set, and all Content that is created or modified needs to have the newly created Content Set id attached. The Content Set id is created using an auto increment field in MySQL during page load.

Problem details:
I have a page that uses ajax to pull up a Content Set creation dialog. The dialog submits to a blank URL, because it may be called from more than one location, and I want the dialog to submit to whatever url it was called from. After the dialog submits to the page it was called from, some PHP on the page creates a Content Set record in the MySQL database. I need the newly created record’s insert id to be passed from page to page using a GET variable (easiest method since I already pass pagination variables this way), but since the page has to load before I can get the insert id, I have no way of populating all of the places that the GET variable needs to inhabit (on page links, php $_GET variable, the url).

Some things to consider:

  • I would pass the newly created insert id around via a session variable, except this causes problems when someone hits the back button, and the session variable does not revert to its previous value.
  • I would use Javascript and PHP to change the various places this insert id variable is used, except if they pull up another ajaxed dialog that submits to a blank url, the blank url will of course not have the new GET variable. Also, this seems very sloppy and would be a nightmare to maintain.
  • I would, after creation of the record, redirect back to the same page after adding the new GET variable, except I would not be able to pass POST vars thus making error and success messages a complete pain in the ass. I wouldn’t want to use GET vars to tell the page what error/success message to display because GET vars get passed around page to page using $_SERVER[‘QUERY_STRING’] as well as blank links.
  • I could simply not make the newly created Content Set autoload after creation. This makes the user go the extra step of loading the newly created Content Set themselves, which I would like to avoid.

Is there any sort of elegant solution to this? This problem may be very unique due to the way the website is set up, but someone has to have dealt with something similar. I am hoping not to have to alter the site design too much in order to solve this one little issue. Any ideas are welcome.

  • 1 1 Answer
  • 3 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-18T04:39:43+00:00Added an answer on May 18, 2026 at 4:39 am

    I would have to agree with a session based solution here. Keep in mind that you should be able to create a mechanism to revert back to the old value if the users hits back. For this you would need three sessions variables one with the current value of the id, one with the previous value of the id and one that holds the url of the last page you were on. This way you should be able to check whether a user has hit the back button by checking if the current url is equal to the last url stored in your session variable and if so revert back to the old id.

    Please note that this is just a general concept and I am sure you will come across some technical issues that need figuring out before a system like this works properly.

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

Sidebar

Related Questions

I'm finding it difficult to describe this problem very concisely, so I've attached the
I'm new to regular expressions and i'm feeling this very difficult to solve: I
This is probably a very difficult problem to troubleshoot with the information I can
It is very difficult for me to explain this particular problem/question so please bear
This is a difficult problem to describe so please let me know if anything
This very strange. When I resize a WinForms dialog the controls are flickering very
I have a very difficult problem I'm trying to solve: Let's say I have
I need your support because I have got very difficult problem. I would like
Today I ran into a very difficult TDD problem. I need to interact with
This has been very difficult to track down and has caused me a great

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.