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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T08:27:38+00:00 2026-06-06T08:27:38+00:00

How can I display an alert or a message after a user clicks a

  • 0

How can I display an alert or a message after a user clicks a submit button in a form?

I want the alert to show when the page has loaded after the submit button has been clicked.

When submit form is clicked its goes to another php page updated the db and and redirected to the form page itself. I am doing it in PHP. Is there anyway I can post data, check in the form page and display a hidden message?

header('Location: http://www.xxxxxx.co.uk/NottTest/editqr.php');

This is the redirect link after updating the DB, can I parse a message here?

This is the page where the db is updated ..

<body>

<p>
 <?php $sltdtpst= $_POST["qrtopic"]; ?>
 <?php $selctsm= $_POST["qrsubmenu"]; ?>
 <?php $selcttxt= $_POST["text12"]; ?>

 <?php
$link = mysql_connect('www.xxxxx.co.uk', 'xxxxxx', 'xxxx');
if (!$link) {
    die('Could not connect: ' . mysql_error());
}

mysql_select_db("web3fffasd", $link);

 $update = "UPDATE qr_table SET $selctsm = '$selcttxt' WHERE id_qr= $sltdtpst";

  mysql_query($update, $link);

mysql_close();


header('Location: http://www.xxxxxx.co.uk/NottTest/editqr.php');

?>


</p>

</body>

So after updating the database a hidden should be displayed here in the form page

<form name="updateqrnew" form action="edider1.php" onsubmit="return validateForm()" method="post">

    <div class="form_description">
            Update Contents for QR below
</div>                      
            <ul >

                    <li id="li_2" >
        <label class="description" for="element_2">Quick refresher topics </label>
        <div>
        <select class="element select medium" id="qrtopic" name="qrtopic"> 
            <option value="" selected="selected"></option>
<option value="1">Anxiety</option>

        </select>
        </div> 
        </li>       <li id="li_3" >
        <label class="description" for="element_3">Submenu </label>
        <div>
        <select class="element select medium" id="qrsubmenu" name="qrsubmenu"> 
            <option value="" selected="selected"></option>
<option value="start_of">Starting off</option>


        </select>
        </div> 
        </li>       <li id="li_4" >
        <label class="description" for="element_4">Enter the article below</label>
        <div>
            <textarea id="text12" name="text12" class="element textarea medium"></textarea> 
        </div> 
        </li>

                    <li class="buttons">
                <input type="hidden" name="form_id" value="431595" />

                <input id="saveForm" class="button_text" type="submit" name="submit" value="Update" />
        </li>
            </ul>
    </form>
  • 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-06-06T08:27:40+00:00Added an answer on June 6, 2026 at 8:27 am

    Let me see if I understand this

    1. The user clicks on a submit button,
    2. the action script processes it, then
    3. does a redirect to a new script,

    and you want to inform the user that their update worked, is that it?

    In this case, what you may want to look at is passing a result code from the action script to the redirect script. Then the redirect script can lookup the result code passed in a emit the proper message to the user. (Does not have to be a pop-up, necessarily in this scenario.) Passing the result code can be done in a few ways, including using the query string, or using a cookie, or using sessions. The first is easy, but makes for a slightly more messy URL. The second is rather deprecated. The third is the more generally accepted way of doing this, but if this is the only place you’d need a session, is probably overkill for your application.

    Using the query string, your redirect may look like this:

    header('Location: http://www.xxxxxx.co.uk/NottTest/editqr.php?r=1');
    

    where 1 can be a code for sucess, for example, or you could have other codes if there was an error you wanted to display, etc. If you need more information than just a code, you can pass that on the query string as well. Note that this does present some application security issues, so you have to ensure that your code will do the right thing if someone simply calls the redirect script directly with a query string that means something has happened in your application. That is why it’s not the best way to do this.

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

Sidebar

Related Questions

How can I display an alert after a user clicks a submit button in
I want to display a alert message when a user clicks on button. I
I want to display alert message and then refresh the page. But it take
I want to develop JSF page which can display the swap size if the
I'm using jQuery to show a success message after a form is submitted. The
Here's the response: {Message:Authentication failed.,StackTrace:null,ExceptionType:System.InvalidOperationException} how can i display an alert box with the
How can i display an alert message or alert box when getting the information(not
Examotion has a player that can display the image for svg files as a
Is there any firefox addon which can display my asp.net page viewstate size.... Any
I'm wondering how I can display the recently created nodes by a user on

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.