Re: Registering Session
| From: | Curt Zirzow | Date: | Wed, 30 Jul 2003 22:25:01 +0000 |
| Subject: | Re: Registering Session | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-157614@lists.php.net to get a copy of this message | ||
* Thus wrote Ralph Guzman (ralph@nqionline.com):
> I have a shopping cart checkout form where I am using GET to specify
> payment method from payment_method.php page.
>
> So I have something like the following:
>
> From payment_method.php the user chooses payment method by clicking on a
> payment link that then send them to the checkout_form.php
>
> checkout_form.php?form=cc for credit card
> checkout_form.php?form=ch for credit check
> checkout_form.php?form=ph for phone
>
> since checkout_form is broken down into multiple forms, I am using
> session_register to set form type in checkout_form.php
>
> $form_type = $_GET['form'];
> session_register('form_type');
>
> The problem is that at times it registers $form_type properly as 'cc,
> ch, or ph', but other times it registers $form_type as 'Object'.
You did read all the documentation on session_register right? I
would avoid using session_register because of its ability to be
dangerous. Instead use the $_SESSION[] method of using session.
session_start();
$_SESSION['form_type'] = $_GET['form'];
Curt
--
"I used to think I was indecisive, but now I'm not so sure."