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? 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? 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 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. 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. 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? 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. 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. 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. 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. Link to comment https://forums.phpfreaks.com/topic/68262-solved/#findComment-343271 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.