Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

What sets this: isset($HTTP_POST_VARS['edit_x']


smartwork

Recommended Posts

isset($HTTP_POST_VARS['edit_x']

 

What is "edit_x" and "edit_y"? This is in the section where it inserts/updates a product in admin/categories.php

 


case 'insert_product':

     case 'update_product':
       if (isset($HTTP_POST_VARS['edit_x']) || isset($HTTP_POST_VARS['edit_y'])) {
         $action = 'new_product';


    } else {

Link to comment
Share on other sites

I have all the osC versions back to 2.2-MS1.

 

The same code goes clear back to there.

 

Personally I can't find anything in any of the versions that sets those variables.

 

Looks like "orphaned code" to me.

:blink:

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

case 'update_product':

if (isset($HTTP_POST_VARS['edit_x']) || isset($HTTP_POST_VARS['edit_y'])) {

$action = 'new_product';

 

 

This looks like some modification done to your code for customization.

 

Satish

 

Ask/Skype for Free osCommerce value addon/SEO suggestion tips for your site.

 

Check My About US For who am I and what My company does.

Link to comment
Share on other sites

edit_x and edit_y are automatically set by clicking on a button, when that button is an image.

 

Can be very useful to determine the type of click being made by the person who is using your site.

 

By playing with edit_x and edit_y at the processing stage, it is possible to make 1 button do two (or more things).

The X and Y are co-ordinates showing where the button was clicked.

Link to comment
Share on other sites

I modified the admin/categories.php file to write the values of $HTTP_POST_VARS['edit_x'] and $HTTP_POST_VARS['edit_y'] to a file if they ever got set.

 

I clicked every button I could find and nothing ever got written to the file.

:blink:

 

I'm not doubting your explanation. It makes more sense than "orphaned code" making it thru several version of osC.

 

I'm just saying it doesn't ever seem to be getting set on my install.

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

What is "edit_x" and "edit_y"? This is in the section where it inserts/updates a product in admin/categories.php

It's standard oscommerce code and not anything to be concerned about. It is used when the new product button is clicked.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

http://www.w3.org/MarkUp/html-spec/html-spec_8.html#SEC8.1.2.5

 

I'm pretty sure that (most of) 2.3.1 uses jquery buttons, so probably these do not

pass X and Y. Older osc used proper images from the language directory, so they

definitely would pass X and Y.

 

Also if a form is submitted without pressing the button (eg, tab to it and enter)

then I -think- X and Y would not get passed.

Link to comment
Share on other sites

It's standard oscommerce code and not anything to be concerned about. It is used when the new product button is clicked.

 

Yep, that's exactly where I'm at. It all started simply trying to get a thorough understanding of all the processes associated with categories.php, but now I found that I think I broke my "back" button at the new_product_preview stage where I have a back, insert, cancel button. Here's what the source of the resulting page shows which indicates that x & y are set.

 


<input type="hidden" name="x" value="21"><input type="hidden" name="y" value="11">

<input type="image" src="includes/languages/english/images/buttons/button_back.gif" border="0" alt="Back" title=" Back " name="edit">  

<input type="image" src="includes/languages/english/images/buttons/button_insert.gif" border="0" alt="Insert" title=" Insert ">  

<a href="http://www.domain.com/admin/categories.php?cPath=29"><img src="includes/languages/english/images/buttons/button_cancel.gif" border="0" alt="Cancel" title=" Cancel "></a>

 

I still have to see why my back button lost function. It now functions exactly like Cancel. Of course, I'm still trying to full understand what differentiates the back and insert process when the both appear to have the same link associated with them such as the one below. Insert works, back operates like cancel. With this same URL, what differentiates whether it goes back to edit or forward to insert?

 


http://www.domain.com/admin/categories.php?cPath=37&pID=1418&action=insert_product

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...