RE: [PHP-WIN] Need help with functions
| From: | Scott Hurring | Date: | Tue, 30 Apr 2002 20:24:28 +0000 |
| Subject: | RE: [PHP-WIN] Need help with functions | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-13428@lists.php.net to get a copy of this message | ||
I'm not sure if i properly understand what you need,
but *if* i understand; you need to pass the ENTIRE
form to a function.
On the HTML form, name all form fields somethign like:
"form[name]"
"form[email]"
Then, whatever function needs the ENTIRE form,
just pass it the $form array.
If you want to preserve form elements, try
using $form['prev'] = serialize($form);
then making a hidden field named 'prev', and
on the *next* form use: unserialize($form['prev']);
to get at the "previous" values.
---
Scott Hurring
Systems Programmer
EAC Corporation
ScottH@eac.com
Voice: 201-462-2149
Fax: 201-288-1515
> -----Original Message-----
> From: Bob Sears [mailto:rsears@onet.net]
> Sent: Monday, April 29, 2002 9:22 PM
> To: php-windows@lists.php.net
> Subject: [PHP-WIN] Need help with functions
>
>
> I'm into developing a shopping cart using PHP (naturally) and
> am running
> into a little snag.
> I need to be able to perform several tasks within the framework of a
> <form></form> construct:
>
> 1) Call a function from within the module;
> 2) Call an external PHP module (no return) with the
> contents of ALL
> elements within the form;
> 3) Call an external (or a function) that will overlay a
> smaller window
> to display cart contents and
> have the customer click a button to close the window
> (return?).
> All FORM contents needed;
>
> Here is the pseudo code, subject to MAJOR change (obviously) ...
>
> <?
> function function_one()
> {
> print ("I'm in function one ...");
> }
> ?>
> <html>
> <head>
> </head>
> <body>
> <form>
> This is program one ...
> <?
> print ("<a href=\"bob2.php\"> click here</a>"); <----
> This needs to
> transfer to
>
> another module,
> not returning.
> print ("<input type=???">); <----
> This needs to
> enter function_one
> and remain
> within the module
> print ("???????????????"); <----
> This needs to
> transfer to another
>
> module (or call
> another function
>
> within this
> module) to open another
>
> window, display
> the contents of a
>
> shopping cart,
> then have the customer
>
> click a button
> to close with window.
> ?>
> </form>
> </body>
> </html>
>
> Can anyone return this with some pseudo code?
>
> Bob
>