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 Quote 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'. Quote 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 Quote 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']; Quote 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 Quote Link to comment https://forums.phpfreaks.com/topic/72143-solved-php-code-help/#findComment-363882 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.