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 Quote Link to comment 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". Quote Link to comment 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 Quote Link to comment 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" ?> Quote Link to comment 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.