PandemoniumSyndicate
PandemoniumSyndicate

Reputation: 2955

Pass arbitrary url as $_GET variable

Given some arbitrary url:

view.php?viewid=blahblahblah

Is there a way I can encode a query string which has the above URL as a variable and preserves it's (view.php's) query string?

Obviously, for some URL:

obvious.php?obvid=foobarzot&old_url=view.php?viewid=blahblahblah

will not work at all, but is there a php function with which I could encode view.php so that I could pass it around?

Cheers!

Upvotes: 1

Views: 1833

Answers (2)

sascha
sascha

Reputation: 4690

I think you're looking for urlencode()

Upvotes: 1

Niet the Dark Absol
Niet the Dark Absol

Reputation: 324630

urlencode the URL before adding it to the query string.

Upvotes: 5

Related Questions