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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:54:03+00:00 2026-05-26T17:54:03+00:00

I have an HTML form page which I post back to itself in order

  • 0

I have an HTML form page which I post back to itself in order to perform some PHP Validation.

Once posted back to itself and the validation passes, I direct the page to the next link using the string:

echo "<meta http-equiv=\"refresh\" content=\"0;URL=http://www.website.com/planning/page2.php\">"; 

When using this however the page refreshes on itself before going to the next page (page2.php) this means the page flashes again whilst performing validation then redirects. How can I make this not ‘flash’ when performing the validation?

my validation is as follows:

//validation
if(isset($_POST['loadid'])){
$errors = array();
$load=$_POST['loadid'];

if (empty($load)){
$errors[]='<strong><font color=red>Please select a load number</font></strong>';
}


if (!empty($errors)) {
foreach ($errors as $error) {
    echo $error."<br>";
    }}
    else {
        echo "Population accurate";
        echo "<meta http-equiv=\"refresh\" content=\"0;URL=http://www.website.com/planning/page2.php\">"; 
        $_SESSION['sessionloadid']=$_POST['loadid'];

}
}

Thanks for the help,
Ryan Smith

  • 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-26T17:54:04+00:00Added an answer on May 26, 2026 at 5:54 pm

    The flash results because you’re doing the redirect “inside the browser”. That means, the browser needs to load your HTML and then already starts to display it.

    Then the browser sees it should redirect, resets the window (flash) and does the redirect.

    You can prevent this by doing the redirect already with HTTP headers:

    $_SESSION['sessionloadid']=$_POST['loadid'];
    $uri = 'http://www.website.com/planning/page2.php';
    header('Location: '.$uri);
    printf('<a href="%s">Moved.</a>', $uri);
    exit;
    

    instead of:

    echo "Population accurate";
    echo "<meta http-equiv=\"refresh\" content=\"0;URL=http://www.website.com/planning/page2.php\">"; 
    $_SESSION['sessionloadid']=$_POST['loadid'];
    

    A browser processes HTTP headers before starting to display the page, it then sees the redirect and redirects (often automatically). If the browser does not redirect automatically, a short “Moved.” message is displayed, so the user can navigate to the new location by clicking the link.

    See as well the http_redirect function, that offers more to make redirects with PHP. If you don’t have the extension available, the function documentation shows multiple points you should take care about when doing redirects with PHP:

    • Using an absolute URI.
    • Offering a HTTP body.
    • Specifying the redirect code (301, 302, …).
    • Exiting the script.

    If you don’t have that function available, I suggest you write one that does the same, so you can easily do redirects within your application.

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

Sidebar

Related Questions

I have a form on my index.html page which makes a POST request to
I have a html page with a form. The form has Div which gets
I have a simple html form. On php page. A simple list is placed
I have a form on an HTML page with multiple submit buttons that perform
I have a PHP page receiving input from an HTML form via $_POST. The
I have a simple contact form which uses jquery to post to a php
i have a page,say abc.html, that is having a small form with some fields.
i have a form that submits some data and gets html back. this html
I have a product management page that contains a textarea in which some html
I have a html form that posts to a new page on submit. If

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.