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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T20:10:46+00:00 2026-05-29T20:10:46+00:00

I have a PHP site (with CodeIgniter) that includes a registration form. I have

  • 0

I have a PHP site (with CodeIgniter) that includes a registration form. I have a page with some details, which links to the form on a separate page. The form posts to a third URL which does the processing and redirects back to the first page if it’s successful (or the form page if not).

Currently I am adding a parameter for success: example.com/page?success=1 which shows a success message. The problem is that some people have been sharing this URL (and clicking the Facebook Like button) so when another user opens that URL they see a message “thanks for registering!” which they obviously haven’t done yet.

I thought this was the standard way of doing forms (submitting to one URL and redirecting to another) but is there a better way? I don’t want to post back to the same page because then you get the POSTDATA warning when trying to reload the page.

  • 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-29T20:10:47+00:00Added an answer on May 29, 2026 at 8:10 pm

    Typically you would set your flag for success in the session to display this message when the next page loads. This is commonly referred to as a Flash Message. You would then check the value/existence of this session flag and show your message or not accordingly. In most frameworks there is built in functionality for this which includes the clean up of the flag on the next request so that the message is only displayed directly after the action generating it is taken.

    From the CI Sessions Documentation:

    CodeIgniter supports “flashdata”, or session data that will only be
    available for the next server request, and are then automatically
    cleared. These can be very useful, and are typically used for
    informational or status messages (for example: “record 2 deleted”).

    Note: Flash variables are prefaced with “flash_” so avoid this prefix
    in your own session names.

    To add flashdata:

    $this->session->set_flashdata('item', 'value');
    

    You can also pass an array to set_flashdata(), in the same manner as
    set_userdata().

    To read a flashdata variable:

    $this->session->flashdata('item');
    

    If you find that you need to preserve a flashdata variable through an
    additional request, you can do so using the keep_flashdata() function.

    $this->session->keep_flashdata('item');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a PHP-driven site that includes an XML stock feed, which is remotely
I have a PHP / CodeIgniter site with basic social functionality which obviously includes
I have some code on my PHP powered site that creates a random hash
I have a PHP site that uses a fairly common authentication scheme. The entire
In my live site I have php include() and require() that have full path
I have a PHP script that retrieves list of urls from a site and
I have a site with URLs like this: http://domain.co.uk/subdir/page.php I have redesigned the site
I am not very experienced with PHP. I have a site I'm maintaining that
I have a site using CodeIgniter that is almost complete now. My problem is
I have a site that uses wordpress for the frontend & a Codeigniter app

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.