Jump to content

URL Arguments


$cripts

Recommended Posts

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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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'])) ...
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.