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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:34:04+00:00 2026-05-25T19:34:04+00:00

I have a huge form with inputs of type (text, checkboxes, hidden et). The

  • 0

I have a huge form with inputs of type (text, checkboxes, hidden et). The content of the form inputs are taken from a database. The user has to make some changes and to save the data back into the db.

At this moment I’m using a function which has a foreach($_POST as $key=>$value) loop. As you know, there are problems with post method:

  1. can’t make refresh,
  2. can’t go backwards.

I’ll like to use $_GET method, but the length of my variables and values are bigger than 2000 characters.

Do you have any advice for me, about what can I do? Maybe there are some tricks in using $_GET. Maybe i didn’t understand how to use it right?

  • 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-25T19:34:05+00:00Added an answer on May 25, 2026 at 7:34 pm

    There is absolutely nothing wrong in POST itself. You just have to use it properly
    An HTTP standard says you ought to make a GET redirect after receiving POST request.
    So, as easy code as this

        header("Location: ".$_SERVER['PHP_SELF']);
        exit;
    

    after processing your form will solve all your “problems”

    in case you want to handle post errors, you can use POST/Redirect/GET pattern.
    However it does not redirect on error, the problems you mentioned becoming negligible.

    here is a concise example of it:

    <?  
    if ($_SERVER['REQUEST_METHOD']=='POST') {  
      //processing the form    
      $err = array();
      //performing all validations and raising corresponding errors
      if (empty($_POST['name']) $err[] = "Username field is required";  
      if (empty($_POST['text']) $err[] = "Comments field is required";  
    
      if (!$err) {  
        //if no errors - saving data and redirect
        header("Location: ".$_SERVER['PHP_SELF']);
        exit;
      }  else {
        // all field values should be escaped according to HTML standard
        foreach ($_POST as $key => $val) {
          $form[$key] = htmlspecialchars($val);
        }
    } else {
      $form['name'] = $form['comments'] = '';  
    }
    include 'form.tpl.php';
    ?>  
    

    on error it will show the form back. but after successful form submit it will redirect as well.

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

Sidebar

Related Questions

I have a huge ASPX web form which has around 100 fields which need
I have a huge database that has several tables that hold several million records.
I have a huge MySQL table which has its rows encoded in UTF-8 twice.
I have a huge problem with this method im trying to make. I have
I have a form with a pile of input fields. I want to make
I have a pretty large form that consists of radio buttons/checkboxes as well as
I have a query page with a huge form that is filled out by
I have a huge form (for an internal CMS) that is comprised by several
I have a link that is submitting a huge form, with the following code:
I created a huge form. I have to do many actions with Jquery. I

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.