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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T05:16:31+00:00 2026-06-11T05:16:31+00:00

When button pressed: <form action=index.php method=get> <input type=hidden name=act value=run> <input type=submit value=Truncate map>

  • 0

When button pressed:

<form action="index.php" method="get">
  <input type="hidden" name="act" value="run">
  <input type="submit" value="Truncate map">
</form>

if (!empty($_GET['act'])) {
  mysql_query("TRUNCATE TABLE mapinfo");
} 

It redirects me to index.php?act=run

I want to get rid of it so added: header("Refresh: 0; url=$page");:

if (!empty($_GET['act'])) {
  mysql_query("TRUNCATE TABLE mapinfo");
  $page = $_SERVER['PHP_SELF'];
  header("Refresh: 0; url=$page");
} 

but it first loads index.php?act=run than redirecting browser to index.php which makes 2 page refreshes.

How to do it the nice 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-06-11T05:16:32+00:00Added an answer on June 11, 2026 at 5:16 am

    instead of using a refresh header, use

    header("Location: $page");

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

Sidebar

Related Questions

<form name=ipladder id=ipladder action=/checkuser/master-check.php method=post> <input name=ipladder type=text id=ipladder /> <input type=submit name=submit id=botton
First, here is the code: <form action=FirstServlet method=Post> Last Name: <input type=text name=lastName size=20>
I have this form: $form = array( '<form name=backup-form class=backup-form method=post action=#>', '<fieldset class=backup-fields>',
I have a very simple entry form. After a button is pressed, I need
Trying to get a random string out of ListArray on the button pressed. Always
How to use the repaint() method when a button is pressed and Graphics p
Basically, I like the way that <input type=submit> is styled, with the clickable button
I have a form with an input element but no submit button. I use
In C#, Suppose I am in a form, and I pressed a button I
I have a form which once the Submit button is pressed, it goes to

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.