Posted By

snaidoo on 01/12/11


Tagged

get magento


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

qubestream


Query String Variables


 / Published in: PHP
 

  1. <?php
  2. // This...
  3. $productId = $_GET['product_id'];
  4.  
  5. // ...is the same as ...
  6. $productId = Mage::app()->getRequest()->getParam('product_id');
  7.  
  8. // The second parameter to getParam allows you to set a default value
  9. // The default value is returned if the GET value you're looking for isn't set
  10. $productId = Mage::app()->getRequest()->getParam('product_id', 44);
  11.  
  12. ?>

Report this snippet  

You need to login to post a comment.