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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:56:27+00:00 2026-05-26T15:56:27+00:00

I have a index.php in the root folder dealing with all the commands. In

  • 0

I have a index.php in the root folder dealing with all the commands. In page of url “root/?a=a&b=b”, I have a form for POST to add new item.

After submit the form, the page should be back to “root/?a=a&b=b” and a new item is shown (I currently use header(‘Location: ‘ . $_SERVER[‘HTTP_REFERER’])).

In the meantimes, there is a div in page “root/?a=a&b=b”. If the page comes back from submitting the form, it should be shown; otherwise (GET to this page), it should be hidden.

I currently add a “&success=true” at the end of the the url. But after submitting the form, there is a “&success=true” in the url, and if I refresh the page, although not coming back from submitting form, the div is still shown.

I wonder if there is a way to pass a variable instead of modifying the url after submitting the form. In addition, I don’t want to use $_SESSION.

Thanks for helping!

  • 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-26T15:56:28+00:00Added an answer on May 26, 2026 at 3:56 pm

    This is a common problem and the cleanest method I know to work around this when using Post-Redirect-Get is to set a cookie in the response to the POST and then immediately delete it in the response to the GET.

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

Sidebar

Related Questions

I have a website with the following files in the root folder: index.wml index.php
I have a site with index.php in the root folder, images in /img ,
I have the following rule that redirects all traffic to index.php when public folder
I have a file which name is load.php near index.php in root folder. So
I have a website running on the root folder of my host /index.php I
I have an index page index.php , and when the user clicks on a
I have the following scenario. I have a index.php page with the following JQuery
I have a page index.php where i have a link called add_users.php. In add_users.php,
I have a folder structure like this: /articles .index.php .second.php .third.php .fourth.php If I'm
I have a function that I use on index.php page and I would like

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.