shage Posted November 10, 2007 Share Posted November 10, 2007 If my url contains following http://www.yahoo.com/josh=birthday or josh=graduation or mike=birthday for a family album what is the best way to pull out josh and birthday or mike and birthday Link to comment https://forums.phpfreaks.com/topic/76796-another-noob-question/ Share on other sites More sharing options...
thebadbad Posted November 10, 2007 Share Posted November 10, 2007 If you mean example.com/index.php?josh=birthday, then $_GET['josh'] will contain "birthday". But I guess you want to use example.com/index.php?name=josh&event=birthday, where $_GET['name'] would contain "josh" and $_GET['event'] would contain "birthday". Link to comment https://forums.phpfreaks.com/topic/76796-another-noob-question/#findComment-388813 Share on other sites More sharing options...
shage Posted November 11, 2007 Author Share Posted November 11, 2007 that would work if i rewrote the script i bought, the way it works is like i said, im looking for a way to include a file that would pull such info out and get the extra stuff in the db i set on a sep db, like maybe age of the photos, etc Link to comment https://forums.phpfreaks.com/topic/76796-another-noob-question/#findComment-388829 Share on other sites More sharing options...
thebadbad Posted November 11, 2007 Share Posted November 11, 2007 Okay, if your URL's look like example.com/josh=birthday you could use explode() to get "josh" and "birthday": <?php $url = $_SERVER['REQUEST_URI']; // will set $url to "/josh=birthday" $removeslash = explode('/', $url); // $removeslash[1] now contains "josh=birthday" $bits = explode('=', $removeslash[1]); // $bits[0] contains "josh" // $bits[1] contains "birthday" ?> Link to comment https://forums.phpfreaks.com/topic/76796-another-noob-question/#findComment-388998 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.