Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jan 2012
    Thanked 0 Times in 0 Posts

    Help with some [code] please please

    I was hoping someone could point me in the right direction with the following block of code from the file:
    Application_top.php in oscommerce 2.3
    I am trying to change the add to cart code. Instead of actually adding the product to the cart I would like it to be a hyperlink. The link is pulled from the table “products “ (I added a new column call product_url)
    each product has its own url.
    I am just struggling with changing the code to select the link from the d/b and use it for the button.
    Below is the code
    // customer adds a product from the products page
    case 'add_product' : if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) {
    $attributes = isset($HTTP_POST_VARS['id']) ? $HTTP_POST_VARS['id'] : '';
    $cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $attributes))+1, $attributes);
    tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
    If anyone could point me in the right direction I would be very grateful as you can tell I am new to php.

  • #2
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Marion, IA USA
    Thanked 83 Times in 82 Posts
    My first suggestion would be to update and modernize your code. Use of $HTTP_POST_VARS was deprecated many years ago and requires the register_globals directive to be set to ON which by default it is now set to OFF since PHP 4.2 because it can pose security risks and is now currently deprecated itself in PHP 5.3.
    CodingForums Supreme Overlord
    All Hail Spookster


    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts