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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:48:21+00:00 2026-05-26T06:48:21+00:00

I am looking for a neat (clean) way to show a status message after

  • 0

I am looking for a “neat” (clean) way to show a status message after submitting a form.

For example, if a user updates their profile, I want to show a DIV with the text “Your Profile Has Been Updated!”.

Right now I am getting this done this way:

After posting the data and either inserting or updating the database table, I do a header(“Location: updateprofile.php?status=updated”);

This works just fine and dandy, however it isn’t very clean. I don’t want the query string.

Another method I tried was to set a variable of $submitted=1; and not do a redirect after. However, when a user is updating their information it still shows the old information in the form fields until a refresh. So this doesn’t work either.

I know I could use AJAX to submit the form and accomplish it that way, however, for what I am doing I do not want to use AJAX. I want a server side solution.

My only other thought is having to set a $_SESSION variable then somehow remove it after showing the status update.

Any ideas would be appreciated!

Thanks,

Tony

  • 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-26T06:48:22+00:00Added an answer on May 26, 2026 at 6:48 am

    Most of the time this is handled through session variables that store whatever flash messages need to be shown.

    In a shared view (layout, element) put something like

    <?php
        if (isset($_SESSION['flashMessage']) && !empty($_SESSION['flashMessage'])) {
            echo <<<EOF
            <div class="flashMessage">
                {$_SESSION['flashMessage']}
            </div>
    EOF;
            unset($_SESSION['flashMessage']);
        }
    ?>
    

    Set $_SESSION['flashMessage'] to “Your profile has been updated.” in whatever code is handling your form submissions.

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

Sidebar

Related Questions

I am looking for a neat/clean way to store a list of strings into
I am looking for a neat way to space my form elements but i
I'm looking for a neat and efficient way to replace characters in XML document.
I'm looking for a neat way to override a class from the bootstrap class
I am looking for a neat way to find the largest common part of
I'm looking for a neat way to implement a cool design pattern for my
I'm looking for a neat way of getting the URL of the current document
I have just been looking into Linq with ASP.Net. It is very neat indeed.
Does anyone know of a neat way in java or any packages that will
I'm looking for a pythonic way of iterating over first n items of an

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.