supanoob Posted February 6, 2007 Share Posted February 6, 2007 ok, so i want to have some tips on the side of my page that will need to change with each page, but i dont want to have to edit all the pages tips if they change slightly so im using 1 document and on include statement. now i need a way to find out what tip needs to be included on each page and when. if there anyway of doing this. without having a &tip=1 etc in the url since i want the tips to be disabled if the person wishes. Link to comment https://forums.phpfreaks.com/topic/37284-solved-tips-help/ Share on other sites More sharing options...
trq Posted February 6, 2007 Share Posted February 6, 2007 You could pass the tip id around in the $_SESSION array. Or, if it doesn't exist in the url then its disabled. eg; <?php if (!isset($_GET['tip'])) { // tips are disabled. } else { // display tip } ?> Link to comment https://forums.phpfreaks.com/topic/37284-solved-tips-help/#findComment-178147 Share on other sites More sharing options...
supanoob Posted February 6, 2007 Author Share Posted February 6, 2007 i dont umderstand what you mean, i have it so they can choose wether to show tips or not, its just i want certain tips to be shown on certain pages, i just dont have a way for the tips page to know what tip to show since it doesnt know what page it is on. Link to comment https://forums.phpfreaks.com/topic/37284-solved-tips-help/#findComment-178157 Share on other sites More sharing options...
trq Posted February 6, 2007 Share Posted February 6, 2007 Well if you allready have the disable thing in place, just check that, then check the tips variable within the url if needed. eg; <?php if (enabled_tips()) { // check to see if tips are enabled if (isset($_GET['tip'])) { $tipid = $_GET['tip']; // display tip # $tipid } } ?> Link to comment https://forums.phpfreaks.com/topic/37284-solved-tips-help/#findComment-178164 Share on other sites More sharing options...
supanoob Posted February 6, 2007 Author Share Posted February 6, 2007 so thats the only way? Link to comment https://forums.phpfreaks.com/topic/37284-solved-tips-help/#findComment-178167 Share on other sites More sharing options...
trq Posted February 6, 2007 Share Posted February 6, 2007 so thats the only way? No... but whats wrong with it? Link to comment https://forums.phpfreaks.com/topic/37284-solved-tips-help/#findComment-178169 Share on other sites More sharing options...
supanoob Posted February 6, 2007 Author Share Posted February 6, 2007 nothing i just thought there would be another way since the url is easily changed not that it affect the game in anyway. Link to comment https://forums.phpfreaks.com/topic/37284-solved-tips-help/#findComment-178176 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.