Re: Newbie question, Which way is best?
| From: | Andrew Ballard | Date: | Wed, 19 Mar 2008 20:05:27 +0000 |
| Subject: | Re: Newbie question, Which way is best? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-271848@lists.php.net to get a copy of this message | ||
On Wed, Mar 19, 2008 at 3:47 PM, George J <georgejamieson@btconnect.com> wrote:
> Hi,
>
> I have a script that contains a form and a pagination routine that calls
> itself. I want to pass an sql query along with some other variables to the
> called script. The code to acheive this, using the form, is working but when
> I try to write the code, using the scripts URL to call itself, I am having
> problems successfully passing the SQL query string within the url.
>
> The form is used to construct a string containing a sql query. Whereas when
> the pagination calls the script all it does is changes the LIMIT part of the
> sql query. I know it won't pass the original query unless I add it to the
> URL address.
>
> Is there a 'proper' way to write this code? Should I add the query to the
> URL or is there a better way?
>
> TIA
> George
My personal preference is to add all of the query parameters as hidden
fields in your form and pass them along from page to page. I wouldn't
send the actual SQL query (or any part of it) as part of the URL.
Andrew