verdrm Posted September 6, 2007 Share Posted September 6, 2007 Can anyone tell me the purpose and use of, for example, http://www.url.com/?page=pagename? How do you design a website to use ?page=pagename and is it a good idea to do that instead of just linking to each individual page? Quote Link to comment https://forums.phpfreaks.com/topic/68262-solved/ Share on other sites More sharing options...
squiggerz Posted September 6, 2007 Share Posted September 6, 2007 I'm guessing you meant something like http://www.url.com/file.php?page=pagename Right? Quote Link to comment https://forums.phpfreaks.com/topic/68262-solved/#findComment-343190 Share on other sites More sharing options...
SammyGunnz Posted September 6, 2007 Share Posted September 6, 2007 Read this... http://www.w3schools.com/php/php_get.asp Quote Link to comment https://forums.phpfreaks.com/topic/68262-solved/#findComment-343191 Share on other sites More sharing options...
sneamia Posted September 6, 2007 Share Posted September 6, 2007 I personally find that method the best. It many benefits of using an iframe without actually using one. You would need to use index.php page GET variable as a switch. switch (htmlentities($_REQUEST['page'])) { case 'pagename': require_once('content/news.php'); break; case 'details': require_once('content/productdetails.php'); break; default: require_once('content/index.php'); } I'm guessing you meant something like http://www.url.com/file.php?page=pagename Right? There is nothing wrong with what he posted. Quote Link to comment https://forums.phpfreaks.com/topic/68262-solved/#findComment-343193 Share on other sites More sharing options...
verdrm Posted September 6, 2007 Author Share Posted September 6, 2007 Thanks, sneamia. You can do this: file.php?page=pagename but also ?page=pagename as well. Quote Link to comment https://forums.phpfreaks.com/topic/68262-solved/#findComment-343214 Share on other sites More sharing options...
sneamia Posted September 6, 2007 Share Posted September 6, 2007 Thanks, sneamia. You can do this: file.php?page=pagename but also ?page=pagename as well. Did you find a problem with the code I provided? Quote Link to comment https://forums.phpfreaks.com/topic/68262-solved/#findComment-343215 Share on other sites More sharing options...
verdrm Posted September 6, 2007 Author Share Posted September 6, 2007 No, sorry, I was replying to your post and squiggerz as well at the same time. Quote Link to comment https://forums.phpfreaks.com/topic/68262-solved/#findComment-343229 Share on other sites More sharing options...
wildteen88 Posted September 6, 2007 Share Posted September 6, 2007 Can anyone tell me the purpose and use of, for example, http://www.url.com/?page=pagename? How do you design a website to use ?page=pagename and is it a good idea to do that instead of just linking to each individual page? You'd only be able to use the following url: http://www.url.com/?page=pagename If you have a index.php file in the root of your website. If you don't have an index.php file you'll have to specify a file, so http://www.url.com/?page=pagename is the same as http://www.url.com/index.php?page=pagename When you have a index.php file in the root of folder/your sites root that file will always get called if not file is requested. Quote Link to comment https://forums.phpfreaks.com/topic/68262-solved/#findComment-343250 Share on other sites More sharing options...
sneamia Posted September 6, 2007 Share Posted September 6, 2007 No, sorry, I was replying to your post and squiggerz as well at the same time. Ok, then hit the topic solved button. If you have a index.php file in the root of your website. If you don't have an index.php file you'll have to specify a file, so Though it could be .asp, .jsp, .html, etc. Quote Link to comment https://forums.phpfreaks.com/topic/68262-solved/#findComment-343258 Share on other sites More sharing options...
verdrm Posted September 6, 2007 Author Share Posted September 6, 2007 @wildteen88 Thanks, I do understand that. Quote Link to comment https://forums.phpfreaks.com/topic/68262-solved/#findComment-343271 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.