toolman Posted January 18, 2011 Share Posted January 18, 2011 Hi there, Is it possible to hide text on a page using PHP? For example, hide the word "hello" every time it appears on the page? Or have it display in a different color? Quote Link to comment https://forums.phpfreaks.com/topic/224890-hiding-text-on-a-page/ Share on other sites More sharing options...
Maq Posted January 18, 2011 Share Posted January 18, 2011 Hi there, Is it possible to hide text on a page using PHP? For example, hide the word "hello" every time it appears on the page? Or have it display in a different color? Sure, but we are going to need to see some code before we can help. Quote Link to comment https://forums.phpfreaks.com/topic/224890-hiding-text-on-a-page/#findComment-1161574 Share on other sites More sharing options...
toolman Posted January 18, 2011 Author Share Posted January 18, 2011 It is actually relating to a previous post I made about hiding ($0.00) from a drop down menu. I couldn't find a solution, so I thought I can try to hide specific text inside the drop down. This is the code for the drop down: <?php $products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' AND patrib.options_values_price > 0.00 and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' order by popt.products_options_name"); while ($products_options_name = tep_db_fetch_array($products_options_name_query)) { $products_options_array = array(); $products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "'"); while ($products_options = tep_db_fetch_array($products_options_query)) { $products_options_array[] = array('id' => $products_options['products_options_values_id'], 'text' => $products_options['products_options_values_name']); //if ($products_options['options_values_price'] != '0') { if ($products_options['price_prefix']=='+') { $products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $currencies->display_price($products_options['options_values_price']+$product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') '; } else if ($products_options['price_prefix']=='-') { $products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $currencies->display_price($product_info['products_price'] - $products_options['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') '; } else { $products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $currencies->display_price($products_options['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') '; } //} } if (is_string($HTTP_GET_VARS['products_id']) && isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']])) { $selected_attribute = $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']]; } else { $selected_attribute = false; } ?> <strong><?php echo $products_options_name['products_options_name'] . ':'; ?></strong><br /><?php echo tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute); ?> Thanks Quote Link to comment https://forums.phpfreaks.com/topic/224890-hiding-text-on-a-page/#findComment-1161576 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.