I have built a simple form (form1) that collects some user information and passes the data to another page . This page starts a session, defines some global SESSION arrays, displays the information from the first form and gives the user the opportunity to fill out an additional form (form2).
Form2 submits to a form-to-email program, FormMail. I can successfully submit to FormMail, but only the data gathered from form2.
I have some questions about how to submit all the data gathered in form1, in addition to the data from form2.
Below is part of the code from form2. The error message that I am getting is:
Parse error: parse error, expecting T_STRING' orT_VARIABLE' or `T_NUM_STRING' in /disk2/www/services/awareness/profile/profile2.php on line 62
It is referring to the line:
<INPUT TYPE=\"hidden\" NAME=\"realname\" VALUE=\"<?php echo $_SESSION['realname']; ?>">
************CODE FOLLOWS******************
<?php
session_start();
// Get the user's input from the form
$realname = $POST['realname'];
$address = $POST['address'];
$city = $POST['city'];
$phone = $POST['phone'];
$email = $POST['email'];
$agency = $POST['agency'];
$zip = $POST['zip'];
$type = $POST['type'];
$required = $POST['required'];
$redirect = $POST['redirect'];
$subject = $POST['subject'];
$recipient = $POST['recipient'];
// Register session key with the value
$SESSION['realname'] = $realname;
$SESSION['address'] = $address;
$SESSION['city'] = $city;
$SESSION['phone'] = $phone;
$SESSION['email'] = $email;
$SESSION['agency'] = $agency;
$SESSION['zip'] = $zip;
$SESSION['type'] = $type;
$SESSION['required'] = $required;
$SESSION['redirect'] = $redirect;
$SESSION['subject'] = $subject;
$SESSION['recipient'] = $recipient;
// Display the information:
?>
<b>Your information</b>:
<P />
<b>Name</b>:<? echo $SESSION['realname']; ?>
<br />
<b>Phone</b>:<? echo $SESSION['phone']; ?>
<br />
<b>Email</b>:<? echo $SESSION['email']; ?>
<br />
<b>City</b>:<? echo $SESSION['city']; ?>
<br />
<b>Zip</b>:<? echo $SESSION['zip']; ?>
<br />
<b>Agency</b>:<?php echo $POST['agency']?>
<br />
<b>Recipient</b>:<? echo $_POST['recipient']; ?>
<P />
// DISPLAY SECOND FORM
<?php
If ($_SESSION['type'] == "periodicals") {
echo "
Now, select what you want to track in <em>Periodicals</em>:
<P>
<form action=\"/cgi-bin/FormMailc.pl\" method=\"post\">
<INPUT TYPE=\"hidden\" NAME=\"realname\" VALUE=\"<?php echo $_POST['realname']; ?>">
<INPUT TYPE=\"checkbox\" NAME=\"periodicals\" VALUE=\"TOC\">Table of Contents
<TEXTAREA NAME=\"perTOCkeywords\" ROWS=3 COLS=60 WRAP=HARD></textarea>
<BR>
<INPUT TYPE=\"checkbox\" NAME=\"periodicals\" VALUE=\"Subjects\">Subjects
<TEXTAREA NAME=\"perSubjectskeywords\" ROWS=3 COLS=60 WRAP=HARD></textarea>
<P />
<INPUT TYPE=\"submit\">
";
}
?>
</FORM>