ludjer Posted October 7, 2007 Share Posted October 7, 2007 lets say i am at a webpage with a headder index.php?id=news&nid=show&item=4 what piece of code will allow me to get what is in the url bar thanks Link to comment https://forums.phpfreaks.com/topic/72143-solved-php-code-help/ Share on other sites More sharing options...
JasonLewis Posted October 7, 2007 Share Posted October 7, 2007 you need to use GET. $id = $_GET['id']; $nid = $_GET['nid']; $item = $_GET['item']; echo $id; //would show 'news' echo $nid; //would show 'show' echo $item; //would show '4'. Link to comment https://forums.phpfreaks.com/topic/72143-solved-php-code-help/#findComment-363696 Share on other sites More sharing options...
ludjer Posted October 7, 2007 Author Share Posted October 7, 2007 you need to use GET. $id = $_GET['id']; $nid = $_GET['nid']; $item = $_GET['item']; echo $id; //would show 'news' echo $nid; //would show 'show' echo $item; //would show '4'. ??? so there is no way to get the thing in whole, lets say some one loges on and i want them to return to this webpage there on, will i have to create one for everytype of page :\ if thats the only way ill design some sort of function anyway peace out and thanks Link to comment https://forums.phpfreaks.com/topic/72143-solved-php-code-help/#findComment-363700 Share on other sites More sharing options...
JasonLewis Posted October 7, 2007 Share Posted October 7, 2007 yes you can grab the whole thing using the $_SERVER global variable.. if you output it like this: print_r($_SERVER); you will see all the values it holds... the one you would want is this: $page = $_SERVER['REQUEST_URI']; Link to comment https://forums.phpfreaks.com/topic/72143-solved-php-code-help/#findComment-363717 Share on other sites More sharing options...
ludjer Posted October 7, 2007 Author Share Posted October 7, 2007 OMG dude you are 1337 thanks Link to comment https://forums.phpfreaks.com/topic/72143-solved-php-code-help/#findComment-363882 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.