Odd extra elements in URL after form submission
I have been rewriting the Orders Export mod and have an odd situation.
http://www.zen-cart.com/showthread.p...22#post1256922
I should have started this question here so as not to repeat myself.
When selecting an export range, two odd elements are added to the URL in the address bar. They vary seemingly at random in the numbers, but always look like ...&x=23&y=9.
For example:
Code:
http://localhost/zc151/my_admin/orders_export.php?from_oid=1&to_oid=99&x=38&y=6
I don't know what in the form submission would insert that, and would like to eliminate it.
PHP Code:
<div class="oidSetting"> <!-- Order ID setting inputs -->
<h2><?php echo ORDERSEXPORT_PAGE_HEADING_OID; ?></h2>
<?php echo zen_draw_form('oid_range', FILENAME_ORDERSEXPORT, '', 'get');
echo '<div class="oidInput">' . OEX_FROM_OID_PRE . zen_draw_input_field('from_oid', $limits['orders_id'][0], 'size="10"') . '</div>';
echo '<div class="oidInput">' . OEX_TO_OID_PRE . zen_draw_input_field('to_oid', $limits['orders_id'][1], 'size="10"') . '</div>';
echo '<div class="oidSubmit">' . zen_image_submit('button_save.gif', IMAGE_SAVE) . '</div>';//form submit
echo '</form>';?>
</div>
Re: Odd extra elements in URL after form submission
Quote:
Originally Posted by
gjh42
I have been rewriting the Orders Export mod and have an odd situation.
http://www.zen-cart.com/showthread.p...22#post1256922
I should have started this question here so as not to repeat myself.
When selecting an export range, two odd elements are added to the URL in the address bar. They vary seemingly at random in the numbers, but always look like ...&x=23&y=9.
For example:
Code:
http://localhost/zc151/my_admin/orders_export.php?from_oid=1&to_oid=99&x=38&y=6
I don't know what in the form submission would insert that, and would like to eliminate it.
PHP Code:
<div class="oidSetting"> <!-- Order ID setting inputs -->
<h2><?php echo ORDERSEXPORT_PAGE_HEADING_OID; ?></h2>
<?php echo zen_draw_form('oid_range', FILENAME_ORDERSEXPORT, '', 'get');
echo '<div class="oidInput">' . OEX_FROM_OID_PRE . zen_draw_input_field('from_oid', $limits['orders_id'][0], 'size="10"') . '</div>';
echo '<div class="oidInput">' . OEX_TO_OID_PRE . zen_draw_input_field('to_oid', $limits['orders_id'][1], 'size="10"') . '</div>';
echo '<div class="oidSubmit">' . zen_image_submit('button_save.gif', IMAGE_SAVE) . '</div>';//form submit
echo '</form>';?>
</div>
I have seen in the code these two variables defined and occasionally setup to be added to the uri, but in this case it comes down to an improperly formulated form creating at least in 1.5.x... Assuming you wanted to use a get style form:
Code:
<?php echo zen_draw_form('oid_range', FILENAME_ORDERSEXPORT, '', 'get');
Should be:
Code:
<?php echo zen_draw_form('oid_range', FILENAME_ORDERSEXPORT, 'get');
Removing the extra pair of single quotes and shifting the lineup of the get to the left for the call to zen_draw_form.
Now if there was some parameter that you wanted to pass on, then global variable $parameters would address those that were passed to the page (I think) otherwise you could go and collect the parameters from a function similar to zen_get_params (I forget what it's real name is).
Re: Odd extra elements in URL after form submission
Quote:
Originally Posted by
gjh42
...When selecting an export range, two odd elements are added to the URL in the address bar. They vary seemingly at random in the numbers, but always look like ...&x=23&y=9.
That's the position of the cursor when the "Save" button was pressed, coming from the submit-type button. I'm not sure if there is a way to prevent their insertion.
Re: Odd extra elements in URL after form submission
Other than visually annoying, what is the effect of those values being in the uri? Thought there might be a way to sanitize the string after being transferred to the destination? (Ie, if for some reason testing if $_GET is set, would want to not have those two in the list. Guess could test if they are in there, and then remove them if necessary for code processing, but guess trying to understand what the problem is being there.
Re: Odd extra elements in URL after form submission
As far as I know it's just a visual annoyance. It did look like a page location, and I wondered if it was related to the submit image. On examination, it is definitely the cursor position relative to the top left of the submit image.
Quote:
Removing the extra pair of single quotes and shifting the lineup of the get to the left for the call to zen_draw_form.
That caused the submit to malfunction and simply put "get" in the URL. The format of the form call was taken from others in stock ZC code, as was the image submit button.
I believe "zen_get_all_get_params()" is the function you were thinking of.
Re: Odd extra elements in URL after form submission
Quote:
Originally Posted by
gjh42
As far as I know it's just a visual annoyance. It did look like a page location, and I wondered if it was related to the submit image. On examination, it is definitely the cursor position relative to the top left of the submit image.
That caused the submit to malfunction and simply put "get" in the URL. The format of the form call was taken from others in stock ZC code, as was the image submit button.
I believe "zen_get_all_get_params()" is the function you were thinking of.
My response was provided from review of the zen_draw_form function as provided for ZC 1.5.0 at http://www.zen-cart.com/docs/phpdoc-...nzen_draw_form
Either the function has since been modified or was not updated there... Sorry...