RE: [PHP-WINDOWS] REMOTE SCRIPTING
| From: | Mikey | Date: | Tue, 13 Jun 2000 16:04:03 +0000 |
| Subject: | RE: [PHP-WINDOWS] REMOTE SCRIPTING | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-436@lists.php.net to get a copy of this message | ||
> I do not know if my previous mail was forwarded in the mailing list, so I
> try again.
>
> My question : I use a lot remote scripting with my ASP pages that
> are being
> converted into PHP code. How can I perform this ?
>
> for those who do not know exactly what remote scripting is, let me explain
> you what I would like to do in the PHP pages, maybe someone could help me.
>
> I would like to perform the following :
> lets the user be abble to select an item in a combo. then, for some given
> selected item, I have to search in the database (SQL), to get a
> new list of
> items for a second combo (sounds like a primary list and a
> secondary list),
> see what I mean ?
>
> In other words : How can I do some PHP code after the page has
> been loaded,
> according to the user ?
By it's very definition, PHP cannot do any processing once the code has been
sent to the client.
There are a few ways around your problem, it all depends on what you
prefer...
1). You could submit the response from the first drop-down list back to the
server and have a second page that generates the two lists.
2). You could make all of the possible queires in one go at the start and
output the resujlts as JavaScript arrays. When the user makes a selection
from the first box, you then use JavaScript to change/display the contents
of the first box. If the datasets are large, you may wish to cache the
results to reduce overhead.
3). You could divide the page into separate <iframe>(IE)/<layer>(NS) tags,
and use JavaScript to change the location of the layer that contains the
second box to an encoded URL for a PHP page that produces the drop down
box - I am not to sure how this would impact the form structure of your
document (i.e. if you wanted both drop downs to be part of your next
submission).
I hope this helps...
regards,
Mikey