Sion.S Posted March 2, 2020 Posted March 2, 2020 Hi all. Can any one help me, i am trying to echo the current products ID, so that i can use it in a basic script. I am currently using something similar with category id: <?php $category_query = tep_db_query("select cd.categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " cd where cd.categories_id = '" . (int)$current_category_id . "' and cd.language_id = '" . (int)$languages_id . "'"); $category = tep_db_fetch_array($category_query); $filename = 'includes/descriptions/'.$current_category_id.'.php'; if (file_exists($filename)) { include( $filename ); ?> I would basically like to do the same thing, but with product_id Many thanks, Sion.
♥ecartz Posted March 2, 2020 Posted March 2, 2020 (int)$_GET['products_id'] E.g. https://github.com/gburton/CE-Phoenix/blob/ad0026cd1bbc91043a0fac1117aed6a0f92bd6c2/product_info.php#L21 For security reasons, you should do a cast to int with both. So someone doesn't craft a special URL that allows them to do something malicious. Always back up before making changes.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.