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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T13:53:29+00:00 2026-05-31T13:53:29+00:00

I need to pass back a large string of results to a form, so

  • 0

I need to pass back a large string of results to a form, so that the form can read those results from the URL and then populate the form with them. Problem is, the link ends up being:

&key=value&key=value … until it can’t process anymore (I assume a URL has a length limit?) resulting in my form not being able to fully populate. I need another way to pass values back to my form file.

VIEW.php file (basically just a table of values right as they are from the database, with the first column “id” being a link. When I click on “id”, it goes back to my add.php(form page) and populates the form with the data matching that id)

<table border="0" cellpadding="0" cellspacing="0" id="table">
            <thead>
                <tr>
                    <th>ID</th>
                    <th>NAME</th>
                    <th>MANUFACTURER</th>
                    <th>MODEL</th>
                    <th>DESCRIPTION</th>
                    <th>ON HAND</th>
                    <th>REORDER</th>
                    <th>COST</th>
                    <th>PRICE</th>
                    <th>SALE</th>
                    <th>DISCOUNT</th>
                    <th>DELETED</th>
                    <th></th>
                </tr>
            </thead>
            <tbody>
                <?php } ?>
                    <?php 
                        // loop to fetch data
                        while($row = mysql_fetch_array($result)) {
                        echo "<tr>";
                        echo "<td>
                        <a href='molszewski1_a2_add.php'>$row[id]</a></td>";
                        echo "<td>$row[name]</td>";
                        echo "<td>$row[manufac]</td>";
                        echo "<td>$row[model]</td>";
                        echo "<td>$row[descrip]</td>";
                        echo "<td>$row[onhand]</td>";
                        echo "<td>$row[reorder]</td>";
                        echo "<td>$row[cost]</td>";
                        echo "<td>$row[price]</td>";
                        echo "<td>$row[sale]</td>";
                        echo "<td>$row[discont]</td>";
                        echo "<td>$row[deleted]</td>";

                        $status = "$row[deleted]";

                        echo "<td><a href='molszewski1_a2_delete.php?id=$row[id]&flag=$status&sort=$sort'>";

                        $status = "$row[deleted]";

                        if ($status == 'n') {
                            $flag = "restore";
                            echo "delete";
                        } else if ( $status == 'y') {
                            $flag = "delete";
                            echo "restore";
                        }

                        echo "</a></td>";
                        echo "</tr>";
                    } ?>
                <?php { ?>
            </tbody>
        </table>

ADD.php (form page where the form is supposed to fetch the data and populate it)

<?php
    // If no form has been submitted, present form
    if (empty($_GET))
    {   
        add_form();
    }
    // if a form has been submitted
    else
    {       
        // if form_validity() == 1, proceed to connect
        if (form_validity() == 1)
        {
            // connect to mysql + database
            connect();

            $saleItem = "n";
            $discountItem = "n";

            if( array_key_exists( 'saleItem', $_GET ) && $_GET['saleItem'] == 'y' )
            { $saleItem = "y"; }
            if( array_key_exists( 'discountItem', $_GET ) && $_GET['discountItem'] == 'y' )
            { $discountItem = "y"; }

            // get values from form, insert into database
            $sql=("INSERT INTO inventory (name, 
                                          manufac, 
                                          model, 
                                          descrip, 
                                          onhand, 
                                          reorder, 
                                          cost,  
                                          price, 
                                          sale, 
                                          discont,
                                          deleted)
                   VALUES ('$_GET[itemName]', 
                           '$_GET[manufacturer]', 
                           '$_GET[model]', 
                           '$_GET[description]', 
                           '$_GET[numberOnHand]', 
                           '$_GET[reorderLevel]', 
                           '$_GET[cost]',
                           '$_GET[sellingPrice]', 
                           '$saleItem', 
                           '$discountItem', 'n')");

            // if the query doesn't work, display error message
            if (!(mysql_query($sql))) { die ("could not query: " . mysql_error()); }

            add_form(); 

            // redirect to view.php after form submission
            // use php instead
            echo "<meta http-equiv='REFRESH' content='0;url=molszewski1_a2_view.php'>";
        }
        else
        {
            // if form is not valid (form_validity returns 0), display error messages
            add_form();
        }
    }
    ?>

FUNCTIONS.php (all my functions for stuff like the form)

<?php function page_navigation(){ ?>
<div class="center">
<a href="molszewski1_a2_add.php" id="add"><input type="button" value="ADD" /></a>
<a href="molszewski1_a2_view.php?sort=all&title=VIEW ALL" id="view"><input type="button" value="VIEW" /></a>
<a href="?sort=deleted&title=VIEW DELETED" id="add"><input type="button" value="VIEW DELETED" /></a>
<a href="?sort=active&title=VIEW ACTIVE" id="view"><input type="button" value="VIEW ACTIVE" /></a>
<br />
<br />
</div>
<?php } ?>
<?php function add_form() { ?>
<form action="molszewski1_a2_add.php" method="get" id="form">
    <table width="529px">
        <tr>
            <td>ITEM NAME</td>
            <td><input name="itemName" size="30" type="text" value="<?php echo $_GET["itemName"] ?>"/></td>
        </tr>
        <tr>
            <td>MANUFACTURER</td>
            <td><input name="manufacturer" size="30" type="text" value="<?php echo $_GET["manufacturer"] ?>"/></td>
        </tr>
        <tr>
            <td>MODEL</td>
            <td><input name="model" size="30" type="text" value="<?php echo $_GET["model"] ?>"/></td>
        </tr>
        <tr>
            <td>DESCRIPTION</td>
            <td><textarea name="description" rows="3" cols="20"><?php echo $_GET["description"] ?></textarea></td>
        </tr>
        <tr>
            <td>ON HAND</td>
            <td><input name="numberOnHand" size="30" type="text" value="<?php echo $_GET["numberOnHand"] ?>"/></td>
        </tr>
        <tr>
            <td>REORDER LEVEL</td>
            <td><input name="reorderLevel" size="30" type="text" value="<?php echo $_GET["reorderLevel"] ?>"/></td>
        </tr>
        <tr>
            <td>COST</td>
            <td><input name="cost" size="30" type="text" value="<?php echo $_GET["cost"] ?>"/></td>
        </tr>
        <tr>
            <td>SELLING PRICE</td>
            <td><input name="sellingPrice" size="30" type="text" value="<?php echo $_GET["sellingPrice"] ?>"/></td>
        </tr>
        <tr>
            <td>SALE ITEM</td>
            <td>
                <input type="checkbox" name="saleItem" value="y" <?php if( isset( $_GET['saleItem'] ) ){ ?> checked="checked" <?php } ?> />
            </td>
        </tr>
        <tr>
            <td>DISCOUNTED ITEM</td>
            <td>
                <input type="checkbox" name="discountItem" value="y" <?php if( isset( $_GET['discountItem'] ) ){ ?> checked="checked" <?php } ?> />
            </td>
        </tr>
        <tr>
            <td colspan="2"><input type="submit" value="save" name="submit" id="submit" /></td>
        </tr>
    </table>
</form>
<?php } ?>
  • 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-31T13:53:31+00:00Added an answer on May 31, 2026 at 1:53 pm

    Use method="post" and $_POST (instead of $_GET).

    POST requests can be much larger than GET requests as GET requests are limited by the maximum length of a URL. POST requests are limited by the size of the max_post_size ini-value which is usually a few megabytes.

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

Sidebar

Related Questions

I need to pass back a enum value in perl, how can I do
Do I need to pass back any HTTP headers to tell the browser that
I want to pass back data from a UIDatePicker that is setup like this:
I need to run ant remotelly create/modify xml files for ant pass back results
I need to pass an extra parameter :mobilejs => true from jQuery to a
I need to pass a variable which is captured from client side via jquery
I need to pass a parameter from an EditText and when I click the
I am trying to to solve a problem where I need to pass large
I need to pull a large amount of data from various tables across a
I have a large validation form that is working very well except for one

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.