Jump to content

phatsion2

New Members
  • Posts

    4
  • Joined

  • Last visited

phatsion2's Achievements

Newbie

Newbie (1/5)

1

Reputation

  1. Hi Guys. Thanks for all the Advise. Will look into doing with with JSON.
  2. Thanks for this. that makes life much easier. If i was to set the variable in the url , www.mysite.com/page.php?sion_gallery_id=465 if(isset($_GET['sion_gallery_id'])){ $sion_gallery_id = $_GET['sion_gallery_id'];} Should i use a white list then? Thanks, Sion.
  3. Hi all. i am trying to use php to include a javascript onto different pages, and then "sort of " pass it a var. The bulk of the code will be in an included footer php file. The var will be set in the main page. i have it working as follows: by just using echo 3 times.. the 1st with the first part of the script, the 2nd is the variable, and the 3rd is the rest of the script. The same endcode.php file needs to also be used for pages that wont have a var set, and wont be using the script - hense the isset. <!-- mainPage.php --> <?php $sion_gallery_id = '450'; ?> <?php include(endcode.php); ?> <!-- endcode.php --> <?php if (isset($sion_gallery_id)) {echo "start of javascript.......album/"; echo $sion_gallery_id; echo"/end of script"; } else { echo "var not on set";} ?> This works great, and i can set $sion_gallery_id do different numbers, and it pulls different albums through for diff pages. Is this secure enough as it is? I have read about whitelists, and tried the following: <!-- Headcode.php --> <?php $whitelist = array('465','6', '7','745','450'); ?> <!-- mainPage.php --> <?php include(Headcode.php);?> <?php $sion_gallery_id = '450'; ?> <?phpinclude(endCode.php); ?> <!-- endCode.php --> <?php if (isset($sion_gallery_id)) {if (in_array($sion_gallery_id, $whitelist)) {echo "java script content goes here.......album/"; echo $sion_gallery_id; echo"/end of script"; } else { echo "var not on white list";}} else { echo "No var set"; }; ?> This works when i try it at a basic level. However, when i set it up properly with the headcode and endcode pages being included, and also with all the actual javascript being echoed in endcode.php -- it worked perfectly for the first page. But when i changed the var to a different number, remembering to add this to the whitelist, it wont load - and echoes "var not on white list". ..... but it is? So, do i need to use a white list for this, or have i got the wrong end of the stick anyway. And if i do, can anyone see what may be happening? Is the first var getting cashed somewhere? Any help is much appreciated. Thanks, Sion.
  4. Hi All, i wonder if anyone can help? I am using a a verson of the "print price list" contrib, which will "print" a simple list of products when opened. I use this as an include on other pages on our website where i want a more simple price list. At present, you can click on the product line, and it links to the product info page to the given product. What i would like to do is have the product info page open in a bump box / light box style window - so as to give a quick preview of the page. ( it will open a modified simple version of the product infor page - which i have called "product_info_pop.php ) I have attached the ful code. price_list.php.txt The link parts are: //if item has attributes print $model; print "<td class=\"pricelist\" ><a href=" . tep_href_link( FILENAME_PRODUCT_INFO_POP, "products_id=" . $products_price ['products_id']) . ">test 1 ".$products_price['products_name']."</td>"; print "<td class=\"pricelist\" >".$products_attributes['products_options_values_name']."</td>"; print "<td align=\"right\" class=\"pricelist\"> ". $currencies->display_price($products_price['products_price'], tep_get_tax_rate($products_price['products_tax_class_id'])) ."</td></tr>"; } }else{ // if item has no attributes print $model; print "<td colspan=2 class=\"pricelist\" ><a href=" . tep_href_link( FILENAME_PRODUCT_INFO_POP, "products_id=" . $products_price['products_id']) . ">test 1 ".$products_price['products_name']."</td>"; print "<td align=\"right\" class=\"pricelist\"> ". $currencies->display_price($products_price ['products_price'], tep_get_tax_rate($products_price['products_tax_class_id'])) ." each </td></tr>"; } } else { // if SHOW_ATTRIB is false print $model; print "<td colspan=2 class=\"pricelist\" ><a href=" . tep_href_link( FILENAME_PRODUCT_INFO_POP, "products_id=" . $products_price['products_id']) . ">test 1 ".$products_price['products_name']."</td>"; print "<td align=\"right\" class=\"pricelist\"> ". $currencies->display_price($products_price['products_price'], tep_get_tax_rate($products_price['products_tax_class_id'])) ."</td></tr>"; } } } so i thought that i could just pop in the class="bumpbox" in the line like so: <a href=" . tep_href_link( FILENAME_PRODUCT_INFO_POP, "products_id=" . $products_price['products_id']) . " class="bumpbox"> But no joy. when i try this, it doesnt work at all, and i just get a blank page. Any one got any thoughts? i should point out that im php including this on another page that has all the relevent bumpbox stuff on it. i have tried simply adding target="_blank" to the link too, and i again just get a blank page. If any one can be of any help, at would be great. Cheers, Sion.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.