Jump to content

[Solved] Script probleempje


Recommended Posts

    function hookExtraLeft($params)    
       {        
       global $cookie, $link, $smarty;
       /* Product informations */
       $product = new Product(intval(Tools::getValue('id_product')), false, intval($cookie->id_lang));
       $productLink = $link->getProductLink($product->id, $product->link_rewrite);
       $smarty->assign('productLink', parse_url($productLink,PHP_URL_QUERY));
//        $productLink = preg_replace("/[^\/]*$/","",$productLink);  
       $productLink = preg_replace("#^[^:/.]*[:/]+#i","",$productLink);  
       print_r($productLink);
       $smarty->assign(array(
           'this_path' => $this_path,
           'product' => $product,
           'productLink' => $productLink
       ));



 {l s='Email dit artikel aan vriend(in)' mod='sendtoafriend'}



Geeft als resultaat:
http://www.tweewielersite.nl/tweewielersite/sendtoafriend-form.php?id_product='>http://www.tweewielersite.nl/tweewielersite/sendtoafriend-form.php?id_product=http://www.tweewielersite.nl/tweewielersite/102-sparta-e-motion-damesfiets.html

MAAR dit moet zijn:
http://www.tweewielersite.nl/tweewielersite/sendtoafriend-form.php?id_product='>http://www.tweewielersite.nl/tweewielersite/sendtoafriend-form.php?id_product=102-sparta-e-motion-damesfiets.html

Kan iemand mij helpen met de juiste preg_replace code svp????
THX

Link to comment
Share on other sites

×
×
  • Create New...