Coding problem...
tbell45219 <[email protected]> 3 Jul 2003 17:24:41 -0000
| Newsgroups | gmane.comp.web.oscommerce.devel |
|---|---|
| Message-ID | <6a5f57bc5453739fbf886fc41c8f72f9@osCommerce-Forums> |
This message was sent from: Development
http://forums.oscommerce.com/viewtopic.php?p=191155#191155
----------------------------------------------------------------
I have a problem I'm having trouble trying to figure out.
What I am trying to do is basically be able to store all the serial numbers for a specific product in the database (by hacking a copy of the orders.php)
Therefore, I have added an admin page that lists the products. I click edit and it shows me a list of all serial numbers for that product.
I'm trying to recreate the record paging functionality that is used on so many of the admin pages (ex. , 'displaying 1 to 20 (of 25 orders).......... << page 1 of 2 >>) but theres something going on with the GET.
So, on the main page that I list the products when I click the edit button here is the code:
[code]
$contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_SERIALS, tep_get_all_get_params(array('prodID', 'action')) . 'prodID=' . $oInfo->products_id . '&action=edit') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a>' );
[/code]
This takes the user to the serial numbers page for a specific product. My understanding is that is also sends 'prodID' and 'action' as get parameters on the next page (or at least they show up in the address box. [code]Ex. 'http://www.mydomain.com/admin/serialsnumbers.php?page=1&prodID=29&action=edit' [/code]
The problem is when I try to use the paging arrows on this page, it does not get the GET parameters to tell it that its still on the edit page.
For example when I click on the page arrows (>>) it only shows:
[code]Ex. 'http://www.mydomain.com/admin/serialsnumbers.php?page=2' [/code]
Here is the call to the displaylinks function that builds the page links:
[code]
$orders_split->display_links($orders_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page'], tep_get_all_get_params(array('page', 'prodID', 'action')));[/code]
I thought when you use GET it will show the variables after the page name: Ex. page.php?blah=2&blahblah=1, etc.
I thought at that point they should be availble using HTTP_GET_VARS.
I'm asuming that the function:
[code]tep_get_all_get_params(array('page', 'prodID', 'action'))[/code]
would do the same.
I'm not clear on the GET and POST stuff.
Any thoughts.