$cripts Posted June 2, 2006 Share Posted June 2, 2006 Ok i have test.php?p=userr&f=signature&page=2how would i check if the URL contains page= argument and get rid of it if it does exist Quote Link to comment https://forums.phpfreaks.com/topic/11049-url-arguments/ Share on other sites More sharing options...
poirot Posted June 2, 2006 Share Posted June 2, 2006 isset() and empty()[a href=\"http://www.php.net/isset\" target=\"_blank\"]http://www.php.net/isset[/a][a href=\"http://www.php.net/empty\" target=\"_blank\"]http://www.php.net/empty[/a]May be useful. I don't know what you mean with "get rid of it" though Quote Link to comment https://forums.phpfreaks.com/topic/11049-url-arguments/#findComment-41277 Share on other sites More sharing options...
$cripts Posted June 2, 2006 Author Share Posted June 2, 2006 what do u mean??i want to check the $_SERVER['argv'] if page=somethign exists if it does it want to remove it from the $_SERVER['argv'] variable and stick the argv variable at the end a link so id havetest.php?this=that&page=3becometest.php?this=thatwithout useing $_GET or $_REQUEST Quote Link to comment https://forums.phpfreaks.com/topic/11049-url-arguments/#findComment-41279 Share on other sites More sharing options...
poirot Posted June 2, 2006 Share Posted June 2, 2006 And for what you'd use that?I really don't see anything useful. Maybe changing links to remove unnecessary parts?But in this case, some scripts will accept empty vars. Like:if (isset($_GET['test'])) ... Quote Link to comment https://forums.phpfreaks.com/topic/11049-url-arguments/#findComment-41282 Share on other sites More sharing options...
$cripts Posted June 2, 2006 Author Share Posted June 2, 2006 ok.......well sense ur not helping me.....does it matetr what i use it for?i need a way to proccess the url arguments and remove the page arument from itso i would have like test.php?f=view&t=1&page=5&sort=ASC$arguments = $_SERVER['argv'];// code to remove certain argso i now have test.php?f=view&t=1&sort=ASCand i need to do it from calling a function Quote Link to comment https://forums.phpfreaks.com/topic/11049-url-arguments/#findComment-41288 Share on other sites More sharing options...
kenrbnsn Posted June 2, 2006 Share Posted June 2, 2006 Since you keep on refering to "argv" am I correctly assuming that you are running from the CLI interface to PHP not from a webserver?If that's the case, you probably want to look at the functions [a href=\"http://www.php.net/parse_str\" target=\"_blank\"]parse_str()[/a] and possibly [a href=\"http://www.php.net/parse_url\" target=\"_blank\"]parse_url()[/a].Ken Quote Link to comment https://forums.phpfreaks.com/topic/11049-url-arguments/#findComment-41311 Share on other sites More sharing options...
$cripts Posted June 3, 2006 Author Share Posted June 3, 2006 no im running from the server side but i need to use this for a pagination script as i call it from a function and it creates the url and i need to remove the page= argument Quote Link to comment https://forums.phpfreaks.com/topic/11049-url-arguments/#findComment-41340 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.