Okay, I sort of have this working. Here is what I did.
Page 1:
User enters in data in a form. When submitted, the form uses POST and calls page 2.
Page 2:
Right under the </head> tag, I have the following:
<?php
$qty1 = $POST['qty1'];
$ext1 = $POST['ext1'];
$qty2 = $POST['qty2'];
$ext2 = $POST['ext2'];
$totGC = $POST['totGC'];
$totDols = $POST['totDols'];
$totship = $_POST['totship'];
?>
And, then a little bit down the page I am using hidden tags in another form for those variables like this:
<input type="hidden" name="qty1" value="<?php echo "$qty1"; ?>">
<input type="hidden" name="ext1" value="<?php echo "$ext1"; ?>">
<input type="hidden" name="qty2" value="<?php echo "$qty2"; ?>">
<input type="hidden" name="ext2" value="<?php echo "$ext2"; ?>">
<input type="hidden" name="totGC" value="<?php echo "$totGC"; ?>">
<input type="hidden" name="totDols" value="<?php echo "$totDols"; ?>">
<input type="hidden" name="totship" value="<?php echo "$totship"; ?>">
The user enters in some more data into a form which uses POST and when submitted, goes to page 3.
Page 3.
Once again, I am using the following under the </head> tag:
<?php
$qty1 = $POST['qty1'];
$ext1 = $POST['ext1'];
$qty2 = $POST['qty2'];
$ext2 = $POST['ext2'];
$totGC = $POST['totGC'];
$totDols = $POST['totDols'];
$totship = $POST['totship'];
$details = $POST['details'];
$details2 = $_POST['details2'];
?>
And a little bit down I am using hidden fields for another form like this:
<input type="hidden" name="qty1" value="<?php echo "qty1"; ?>">
<input type="hidden" name="ext1" value="<?php echo "ext1"; ?>">
<input type="hidden" name="qty2" value="<?php echo "qty2"; ?>">
<input type="hidden" name="ext2" value="<?php echo "ext2"; ?>">
<input type="hidden" name="totGC" value="<?php echo "totGC"; ?>">
<input type="hidden" name="totDols" value="<?php echo "totDols"; ?>">
<input type="hidden" name="totship" value="<?php echo "totship"; ?>">
<input type="hidden" name="details" value="<?php echo "details"; ?>">
<input type="hidden" name="details2" value="<?php echo "details2"; ?>">
The user will enter in some more information into another form, which uses POST, and when submitted goes to page 4.
Page 4
This page is a PHP script to encrypt the data from the previous pages into an e-mail message to me. Here is what that script looks like:
<?
$pgp="/usr/local/bin/gpg";
$user="";
$recp="";
$header="From: ***";
foreach ($HTTP_POST_VARS as $key => $value)
{
if($key == "recipient")
{
$recipient = $value;
}elseif($key == "subject")
{
$subject = $value;
}elseif($key == "redirect")
{
$redirect = $value;
}elseif($key == "required")
{
$required = $value;
}elseif($key == "pgp_key")
{
$pgp_key = $value;
}elseif($key == "pgp_local_dir")
{
$pgp_local_dir = $value;
}else
{
$msg .= "$key: $value\n";
}
}
if($required)
{
$required=split(",",$required);
foreach($required as $value)
{
if($$value=="")
{
echo "You must enter the required information!<P>";
echo "Please go back and fill out the form.<BR>";
$goback=1;
}
}
}
if(!$goback)
{
$msg = stripslashes($msg);
$command = 'echo "'.$msg.'" | '.$pgp.' -a --always-trust --batch --no-secmem-warning -e -u "'.$user.'" -r "'.$recp.'"';
$oldhome = getEnv("HOME");
putenv("HOME=***");
$result = exec($command, $encrypted, $errorcode);
putenv("HOME=$oldhome");
$message = implode("\n", $encrypted);
$subject = stripslashes($subject);
mail($recipient,$subject,$message,$header);
if($redirect)
{
header ("Location: $redirect");
}
}
?>
But, when I get th e-mail, the fields from page 1 and page 2 just show me the variable names and not the data in it. What am I doing wrong?
Thank you for any help you can throw my way.