Jump to content


Photo

URL Arguments


  • Please log in to reply
6 replies to this topic

#1 $cripts

$cripts
  • Members
  • PipPipPip
  • Advanced Member
  • 33 posts

Posted 02 June 2006 - 06:48 PM

Ok i have test.php?p=userr&f=signature&page=2
how would i check if the URL contains page= argument and get rid of it if it does exist

#2 poirot

poirot
  • Members
  • PipPipPip
  • Advanced Member
  • 646 posts
  • LocationAustin, TX

Posted 02 June 2006 - 06:51 PM

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
~ D Kuang

#3 $cripts

$cripts
  • Members
  • PipPipPip
  • Advanced Member
  • 33 posts

Posted 02 June 2006 - 07:20 PM

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 have
test.php?this=that&page=3
become
test.php?this=that
without useing $_GET or $_REQUEST

#4 poirot

poirot
  • Members
  • PipPipPip
  • Advanced Member
  • 646 posts
  • LocationAustin, TX

Posted 02 June 2006 - 07:22 PM

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'])) ...
~ D Kuang

#5 $cripts

$cripts
  • Members
  • PipPipPip
  • Advanced Member
  • 33 posts

Posted 02 June 2006 - 07:48 PM

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 it
so i would have
like test.php?f=view&t=1&page=5&sort=ASC
$arguments = $_SERVER['argv'];
// code to remove certain arg
so i now have
test.php?f=view&t=1&sort=ASC
and i need to do it from calling a function

#6 kenrbnsn

kenrbnsn
  • Staff Alumni
  • Advanced Member
  • 8,235 posts
  • LocationHillsborough, NJ, USA

Posted 02 June 2006 - 09:25 PM

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

#7 $cripts

$cripts
  • Members
  • PipPipPip
  • Advanced Member
  • 33 posts

Posted 03 June 2006 - 01:20 AM

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




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users