Results 1 to 6 of 6
  1. #1
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default 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>

  2. #2
    Join Date
    Jul 2012
    Posts
    16,718
    Plugin Contributions
    17

    Default Re: Odd extra elements in URL after form submission

    Quote Originally Posted by gjh42 View Post
    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).
    Last edited by mc12345678; 28 Aug 2014 at 12:17 PM.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  3. #3
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,399
    Plugin Contributions
    87

    Default Re: Odd extra elements in URL after form submission

    Quote Originally Posted by gjh42 View Post
    ...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.

  4. #4
    Join Date
    Jul 2012
    Posts
    16,718
    Plugin Contributions
    17

    Default 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.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  5. #5
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default 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.
    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.
    Last edited by gjh42; 28 Aug 2014 at 03:44 PM.

  6. #6
    Join Date
    Jul 2012
    Posts
    16,718
    Plugin Contributions
    17

    Default Re: Odd extra elements in URL after form submission

    Quote Originally Posted by gjh42 View Post
    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...
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

 

 

Similar Threads

  1. odd fields being added to URL after form submit
    By buckit in forum Basic Configuration
    Replies: 4
    Last Post: 6 Jan 2010, 08:32 PM
  2. Retaining data in form submission
    By ethangreen in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 2 Jun 2009, 08:53 PM
  3. Problem redirecting upon form submission
    By dgsignal in forum Templates, Stylesheets, Page Layout
    Replies: 15
    Last Post: 26 Jun 2008, 06:16 PM
  4. Simple Submission Form in EZ-Pages
    By pensive612 in forum Templates, Stylesheets, Page Layout
    Replies: 7
    Last Post: 18 Apr 2007, 10:46 PM
  5. required file on a submission form
    By iano in forum General Questions
    Replies: 1
    Last Post: 14 Oct 2006, 05:16 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR