dgnzcn Posted June 25, 2013 Share Posted June 25, 2013 hello, my web page links structures like this: index.php?page=contents&pagegroup=products&productid=someproduct and index.php?page=contents&pagegroup=news&productid=somenews my issue: i just wanna include images.php file when using pagegroup=products. But i am not need include images.php file without using pagegroup=products. Quote Link to comment https://forums.phpfreaks.com/topic/279549-php-include/ Share on other sites More sharing options...
trq Posted June 25, 2013 Share Posted June 25, 2013 This isn't exactly a difficult task, what have you actually tried? Quote Link to comment https://forums.phpfreaks.com/topic/279549-php-include/#findComment-1437766 Share on other sites More sharing options...
dgnzcn Posted June 25, 2013 Author Share Posted June 25, 2013 (edited) Not try but i am included images.php file to content.php but when i opening news page images.php still showing there. i do not want this. just need show only in products. there is only one file for all contents contents.php how can i do it? Edited June 25, 2013 by dgnzcn Quote Link to comment https://forums.phpfreaks.com/topic/279549-php-include/#findComment-1437775 Share on other sites More sharing options...
Irate Posted June 25, 2013 Share Posted June 25, 2013 Hint hint: You can test for $_GET['pageproducts']. Quote Link to comment https://forums.phpfreaks.com/topic/279549-php-include/#findComment-1437776 Share on other sites More sharing options...
dgnzcn Posted June 25, 2013 Author Share Posted June 25, 2013 ok, thanks for the answers. i do following it is working for me. if($_GET['pagegroup] == "products"){include("images.php");} if($_GET['pagegroup] == "news"){ include("subnews.php");} Quote Link to comment https://forums.phpfreaks.com/topic/279549-php-include/#findComment-1437813 Share on other sites More sharing options...
Irate Posted June 25, 2013 Share Posted June 25, 2013 Good, glad you figured it out. Oh, another hint, use code tags on this forum when posting code. [code][/code] or [ic][/ic] Quote Link to comment https://forums.phpfreaks.com/topic/279549-php-include/#findComment-1437828 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.