I'm working on a project for a javascript class, but am having trouble with
passing variables.  Unfortunately, I can't do this with PHP (that would be
too easy), but I have to use Javascript to do some calculations and output
based on input from a form on a previous page.  I am trying to understand
what all I would need to access the variables from page one:

index.html --> summary.html --> payment.html --> thankyou.html
Order Form     Order Summary      CC info            Thank You/Confirmation
(I understand that these will become .PHP pages when I incl the PHP code)

The Order Form page collects 7 variables:
$state, $Widget1, $Widget2, $Widget3, $Widget4, $Widget5, $Widget6

The Summary page needs to do some calculations, but I can't access the
variables ("variable undefined..." errors) with JavaScript:
$cost1 = $Widget1 * 10.00
$cost2 = $Widget2 * 20.00
etc...
$subTotal = ($cost1 + $cost2 + etc...)
$shipping = ($Widget1 + $Widget2...etc) * 0.1   // fixed 10% charge
$tax = $subTotal * 0.08
$total = $subTotal + $shipping + $tax

What I am *trying* to do, for lack of a better idea, is on the Summary page:

<?PHP
     import_request_variables("P");
?>

>From here, I'm not sure what to do.  Do I need to print an array?  Should
this be done in the <HEAD> of the page?  Can anyone offer any suggestions
here???

THANX for any/all assistance!

Wm




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to