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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T18:31:28+00:00 2026-05-23T18:31:28+00:00

for example the following file is SamePage.php <!DOCTYPE html> <html lang=en> <head><title>Personal Information</title></head> <body>

  • 0

for example the following file is SamePage.php

    <!DOCTYPE html>
    <html lang="en">
    <head><title>Personal Information</title></head>
    <body>
    <?php
         if(!empty($_POST))
         {
              echo $_POST['var'].'<br />';
              //do a bunch of stuff
              ...
              echo "Inserted into database succesfully! You will now be redirected.<meta http-equiv=refresh content=4;url=database.php><br /></body></html>";//meta refresh gets rid of old POST data
              exit;
         }
     ?>
Add another entery:<br />
<form method="POST" action="SamePage.php"><--!It sends the information to itself-->
name: <input type="text" name="name" size="10" maxlength="25" /><br />
telephone: <input type="text" name="telephone" size="10" maxlength="25" /><br />
birthday: <input type="text" name="birthday" size="10" maxlength="25" /><br />
<input type="submit" value="add" />
<input type="reset" value="clear" />
</form>
</body>
</html>

It’s not very nice to have the exit there and sometimes I don’t want to refresh the page, but it has to be done encase the user presses the refresh on the browser and the same POST data gets sent again and things get messed up. Can anyone think of a better way?

  • 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-23T18:31:29+00:00Added an answer on May 23, 2026 at 6:31 pm

    Best is to send the form to another page and the reload your page… But if you don’t want, you can:

    • Use AJAX
    • Put all your HTML code between { } symbols
    • Use templates (avoid mix PHP and HTML)
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Suppose we have the following HTML file: <html xmlns=http://www.w3.org/1999/xhtml> <head> <title>Test iframe download</title> <script
Given the URL (single line): http://test.example.com/dir/subdir/file.html How can I extract the following parts using
If I have the following example file where each number is represents a byte
I have a data file that looks like the following example. I've added '%'
Following this example, I can list all elements into a pdf file import pyPdf
I have C header file containing the following type definition: // example.h typedef struct
Let's take for example a single file committed in CVS with the following history.
I have the following in an XML file: <entry> ... <link href=http://www.example.com/somelink /> ...
Can you do the following with a Java ResourceBundle? In the properties file... example.dynamicresource=You
Given the following example file: host wallmount { option root-path iscsi:10.0.0.202::::iqn.2012-01.com.enactpc:storage.wall_mount; hardware ethernet 00:15:c5:71:b9:68;

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.