Scope Problem?
Posted: Tue Sep 12, 2006 8:32 pm
I have two php files - form.php, recap.php
form.php contains the php code for both files.
form.php is basically a form filled in by the user
recap.php display a recap of the information collected from the form.php. An array of the information contains a quantity field which is updated by the form input.
I move from form.php to recap.php by use of:
<?php
if (isset($_POST['continue'])) {
include recap.php;
exit();
}
recap.php displays an html table recaping the quantities, prices, etc. from the $products array.
At the same time I create a mail() $body variable with the same information, basically $body .= "[array info]". I know the $body variable is being created (I can display it in the html table).
Recap.php also has a form requesting name and e-mail for use in the mail() message.
Back in form.php, I use if (isset(submit1)) to sent a mail message. I seem to be able to use everything from the recap.php file EXCEPT the $body variable.
ie. the variable in mail($addressee, $subject, $body, $headers) are all good except the $body variable. Nothing I do seems to be able to allow the use of this variable.
This is driving me nuts! Any hints? (Sorry for being a little long-winded.)
form.php contains the php code for both files.
form.php is basically a form filled in by the user
recap.php display a recap of the information collected from the form.php. An array of the information contains a quantity field which is updated by the form input.
I move from form.php to recap.php by use of:
<?php
if (isset($_POST['continue'])) {
include recap.php;
exit();
}
recap.php displays an html table recaping the quantities, prices, etc. from the $products array.
At the same time I create a mail() $body variable with the same information, basically $body .= "[array info]". I know the $body variable is being created (I can display it in the html table).
Recap.php also has a form requesting name and e-mail for use in the mail() message.
Back in form.php, I use if (isset(submit1)) to sent a mail message. I seem to be able to use everything from the recap.php file EXCEPT the $body variable.
ie. the variable in mail($addressee, $subject, $body, $headers) are all good except the $body variable. Nothing I do seems to be able to allow the use of this variable.
This is driving me nuts! Any hints? (Sorry for being a little long-winded.)