Re: $_GET String Edit
| From: | Chris Shiflett | Date: | Sun, 23 Nov 2003 03:45:12 +0000 |
| Subject: | Re: $_GET String Edit | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-170701@lists.php.net to get a copy of this message | ||
--- "Jed R. Brubaker" <jedbrubaker@hotmail.com> wrote:
> Sorry for the confusing initial request. You were correct in assuming
> that I am generating URLs like:
>
> page.php?foo1=bar1&foo2=bar2&foo1=bar3&foo2=bar4
>
> So I suppose the consise follow-up question is how can I get a
> hyperlink to change one of those varibles in the string.
>
> In the past I have just tacked a varible on to the end of the string,
> but I don't want to be redundant.
To make this easy, I really think you need to not use a string like you
keep suggesting and use some other data structure. I mentioned an array,
simply because I think one of PHP's strengths is its rich collection of
array functions.
You can build your query string as the very last step, prior to using it
in a link. While you are constructing it, I think you will find using a
string to be about the most cumbersome approach possible.
Hope that helps.
Chris
=====
Chris Shiflett - http://shiflett.org/
PHP Security Handbook
Coming mid-2004
HTTP Developer's Handbook
http://httphandbook.org/
RAMP Training Courses
http://www.nyphp.org/ramp