perezf Posted March 29, 2006 Share Posted March 29, 2006 how is it possible to change what is displayed in the address barfor instance from [site.com/games.php] to a [site.com/?page=games] Quote Link to comment https://forums.phpfreaks.com/topic/6124-php-change-address-bar-text/ Share on other sites More sharing options...
perezf Posted March 29, 2006 Author Share Posted March 29, 2006 can anyone help me at all Quote Link to comment https://forums.phpfreaks.com/topic/6124-php-change-address-bar-text/#findComment-22081 Share on other sites More sharing options...
craygo Posted March 29, 2006 Share Posted March 29, 2006 Yes you can do it. You will still have to make both pagesyou will have to have at least one page show. like [a href=\"http://site.com/index.php?page=games\" target=\"_blank\"]http://site.com/index.php?page=games[/a]The on the index page all you need to do is include the pageindex.php[code]<?include(''.$_GET['page'].'.php');?>[/code]Ray Quote Link to comment https://forums.phpfreaks.com/topic/6124-php-change-address-bar-text/#findComment-22084 Share on other sites More sharing options...
perezf Posted March 29, 2006 Author Share Posted March 29, 2006 [!--quoteo(post=359800:date=Mar 29 2006, 03:29 PM:name=craygo)--][div class=\'quotetop\']QUOTE(craygo @ Mar 29 2006, 03:29 PM) [snapback]359800[/snapback][/div][div class=\'quotemain\'][!--quotec--]Yes you can do it. You will still have to make both pagesyou will have to have at least one page show. like [a href=\"http://site.com/index.php?page=games\" target=\"_blank\"]http://site.com/index.php?page=games[/a]The on the index page all you need to do is include the pageindex.php[code]<?include(''.$_GET['page'].'.php');?>[/code]Ray[/quote]im not really understanding what your trying to say Quote Link to comment https://forums.phpfreaks.com/topic/6124-php-change-address-bar-text/#findComment-22085 Share on other sites More sharing options...
ober Posted March 29, 2006 Share Posted March 29, 2006 $_GET is a global array that grabs information out of the URL. If someone goes to your site or clicks on a link from your site with the following address: "mysite.com/index.php?page=123" then you're going to find "123" in the variable: $_GET['page'].So in your index page, you need to handle that:[code]<?phpif(isset($_REQUEST['page'])){ switch($_GET['page']) { case "123": include("page123.php"); break; case "foo": include("foobar.php"); break;}else include("main.php");?>[/code]Does that help? Also, please do not bump your thread 12 minutes after posting a question. Someone will get to it. Quote Link to comment https://forums.phpfreaks.com/topic/6124-php-change-address-bar-text/#findComment-22088 Share on other sites More sharing options...
perezf Posted March 29, 2006 Author Share Posted March 29, 2006 [!--quoteo(post=359804:date=Mar 29 2006, 03:35 PM:name=ober)--][div class=\'quotetop\']QUOTE(ober @ Mar 29 2006, 03:35 PM) [snapback]359804[/snapback][/div][div class=\'quotemain\'][!--quotec--]$_GET is a global array that grabs information out of the URL. If someone goes to your site or clicks on a link from your site with the following address: "mysite.com/index.php?page=123" then you're going to find "123" in the variable: $_GET['page'].So in your index page, you need to handle that:[code]<?phpif(isset($_REQUEST['page'])){ switch($_GET['page']) { case "123": include("page123.php"); break; case "foo": include("foobar.php"); break;}else include("main.php");?>[/code]Does that help? Also, please do not bump your thread 12 minutes after posting a question. Someone will get to it.[/quote]im not really understanding on how i can link this code to my links Quote Link to comment https://forums.phpfreaks.com/topic/6124-php-change-address-bar-text/#findComment-22090 Share on other sites More sharing options...
perezf Posted March 29, 2006 Author Share Posted March 29, 2006 is there a tutorial anywhere that would show me step by step Quote Link to comment https://forums.phpfreaks.com/topic/6124-php-change-address-bar-text/#findComment-22095 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.