Re: variables are empty when a script recalls itself ($PHP_SELF)
| From: | Steve Werby | Date: | Tue, 09 Oct 2001 00:06:32 +0000 |
| Subject: | Re: variables are empty when a script recalls itself ($PHP_SELF) | ||
| References: | 1 | Groups: | php.db php.general |
| Request: | Send a blank email to php-db+get-13130@lists.php.net to get a copy of this message | ||
"Sander Peters" <S.Peters@Visionnet.nl> wrote:
> I have the following problem (maybe you know the sollution)
>
> I have a form wich the user can fill up to view certain records in a
> database.
>
> The query is like this
>
> $query_string = "SELECT ID, medianr, date, cat, subcat, titel, descr,
> nrmedia,
> video from movies where 1 and video like \"$video\" and titel like
> \"$titel\"
> LIMIT 0, $nr ";
>
> all those variables come straight from the form.
> The user can also decide how much records he/she wants to see so there's
> also
> a prev/next mechanism in the script.
> The prev/next links have a php_self link so the script calls itself
> again but
> then with a higher limit (offset) value.
>
> But the big problem is:
>
> all the values from ($titel, $nr, etc) the form are empty!
>
> Is there a way to keep those values when the script recalls himself?
Add the key/value pairs (variables and their values) to the query string in
the prev/next links. As an alternative you can use session variables, but I
recommend getting a handle on the easier solution first.
--
Steve Werby
President, Befriend Internet Services LLC
http://www.befriend.com/