digitalgod Posted November 1, 2006 Share Posted November 1, 2006 just wondering how could I use $_GET to get whatever value that's after the ?so something like index.php?digitalgod I need to get the digitalgod part Link to comment https://forums.phpfreaks.com/topic/25847-_get-help/ Share on other sites More sharing options...
Orio Posted November 1, 2006 Share Posted November 1, 2006 You should look into "mod rewrite". You can find information and links in [url=http://en.wikipedia.org/wiki/Mod_rewrite]Wikipedia[/url] :)Orio. Link to comment https://forums.phpfreaks.com/topic/25847-_get-help/#findComment-118014 Share on other sites More sharing options...
.josh Posted November 1, 2006 Share Posted November 1, 2006 if you have index.php?digitalgod=blahin your script you would use$_GET['digitalgod']example:echo $_GET['digitalgod']; // output: blah Link to comment https://forums.phpfreaks.com/topic/25847-_get-help/#findComment-118015 Share on other sites More sharing options...
alpine Posted November 1, 2006 Share Posted November 1, 2006 Or this might be what u are looking for:[code]<?php// index.php?digitalgodecho parse_url($_SERVER['REQUEST_URI'], PHP_URL_QUERY); // digitalgod?>[/code] Link to comment https://forums.phpfreaks.com/topic/25847-_get-help/#findComment-118017 Share on other sites More sharing options...
digitalgod Posted November 1, 2006 Author Share Posted November 1, 2006 thanks [b]Orio[/b], I'll take a look at that, quick question though, I only want the members section to work like that, if I use mod_rewrite do I have to change the entire script or just the part that I need?[b]Crayon Violent[/b], I already know how to do that, I just need the digitalgod part, I want to be able to display a user's profile that way. So someone can go to members.php?crayonviolent and see your profile.[b]Alpine [/b] what would be the difference between that and using mod_rewrite? I haven't read up on mod_rewrite yet so I don't know much about it Link to comment https://forums.phpfreaks.com/topic/25847-_get-help/#findComment-118018 Share on other sites More sharing options...
alpine Posted November 1, 2006 Share Posted November 1, 2006 mod_rewrite is the real thing, my example is faking it ...... Link to comment https://forums.phpfreaks.com/topic/25847-_get-help/#findComment-118019 Share on other sites More sharing options...
digitalgod Posted November 1, 2006 Author Share Posted November 1, 2006 I read a little and noticed that I would have to go and change all of the links in my script... which would be way too much work and almost impossible at this point Link to comment https://forums.phpfreaks.com/topic/25847-_get-help/#findComment-118020 Share on other sites More sharing options...
digitalgod Posted November 1, 2006 Author Share Posted November 1, 2006 Alpine I'm getting this error with your lineWarning: parse_url() expects exactly 1 parameter, 2 given test.php on line 2 Link to comment https://forums.phpfreaks.com/topic/25847-_get-help/#findComment-118026 Share on other sites More sharing options...
alpine Posted November 1, 2006 Share Posted November 1, 2006 Works with me,[quote]mixed parse_url ( string url [, int component] )[/quote]Study the manual on how it works:http://no.php.net/manual/en/function.parse-url.php*EDIT: The manual says PHP 3,4,5 but only PHP5.1.2 up with the "int component" addedExample for PHP4 found here: http://no2.php.net/manual/en/function.parse-url.php#70690 Link to comment https://forums.phpfreaks.com/topic/25847-_get-help/#findComment-118031 Share on other sites More sharing options...
digitalgod Posted November 10, 2006 Author Share Posted November 10, 2006 thanks alpine, it works perfectly now. I knew it had something to do with the php version. Link to comment https://forums.phpfreaks.com/topic/25847-_get-help/#findComment-122889 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.