Dracolas Posted December 15, 2009 Share Posted December 15, 2009 Ok i'm really new to php. I've Seen it where sites have profile pages for their members and i've seen it like www.yoursite.com/profile.php?$username=blah I would like to know how to make that work... in other words how do i make profile.php recognize that the $username in the url is the username to use for the page. Any assistance is appreciated. Link to comment https://forums.phpfreaks.com/topic/185259-profilephpusernameblah-help-please/ Share on other sites More sharing options...
mattal999 Posted December 15, 2009 Share Posted December 15, 2009 Well you could either do: http://www.example.com/profile.php?username=USERNAME Then retrieve it using: $username = $_GET['username']; OR http://www.example.com/profile.php?USERNAME And access it using: $username = $_SERVER['QUERY_STRING']; // Bear in mind that if any other variables are in this it will return the whole string eg. USERNAME&id=2 Link to comment https://forums.phpfreaks.com/topic/185259-profilephpusernameblah-help-please/#findComment-977947 Share on other sites More sharing options...
Dracolas Posted December 15, 2009 Author Share Posted December 15, 2009 Thank You mattal999! I thought I would need to use the get function but I didn't understand how to do that. Thank you for helping me figure this out Link to comment https://forums.phpfreaks.com/topic/185259-profilephpusernameblah-help-please/#findComment-977949 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.