ah ok.. that wouldve simplified it a little if id assigned the inputs to variables and then called them instead.
it almost works now, the inputs are being passed around. The only problem i have now is its not actually sending the email out. Do i need to make a syntax change to my mail() call below? Ive checked over the php manual here http://www.w3schools.com/php/php_mail.asp and it still seems to meet the criteria stated.
When using the form it 'appears' to complete correctly (doesnt fall over and runs the rest of the scripts).
http://www.winyateshc.co.uk/prescriptions2.php?pageid=2 but we're not receiving the email.
<?php
$isformvalid = true;
if((!$_POST['visitormail'] == "" && (!strstr($_POST['visitormail'],"@") || !strstr($_POST['visitormail'],"."))) || (empty($_POST['visitor'])) || (empty($_POST['visitormail'])) || (empty($_POST['notes'])) || (empty($_POST['dobday']) || empty($_POST['dobmonth']) || empty($_POST['dobyear'])) )
{
$isformvalid = false;
include('emailerror.php');
/* calls emailerror page insert if any field is invalid */
}
$todayis = date("l, F j, Y, g:i a") ;
$attn = "Repeat prescription request";
$subject = $attn;
$notes = stripcslashes($_POST['notes']);
$message = "$todayis [EST] \n
From: $_POST[visitor] ($_POST[visitormail])\n
DOB: $dob \n
Medication: $notes \n
Additional Info : IP = $ip \n
Browser Info: $httpagent \n
Referral : $httpref \n
";
if($isformvalid == true) {
$from = "From: $_POST[visitormail]\r\n";
mail("prescriptions@winyateshc.co.uk", $subject, $message, $from);
include('formcorrect.php');
/* calls form correct page insert */
}
?>
contents of "formcorrect.php" (this scripts displays/works correctly)
<!-- Prescription request summary screen -->
<tr>
<td valign="top">
<p align="center">
<font face="Arial, Helvetica, sans-serif" size="2" color="#993333">
<b>Summary of your request</b><br/><br/>
Date:</font> <?php echo $todayis ?>
<br />
<font face="Arial, Helvetica, sans-serif" size="2" color="#993333">
Name :</font> <?php echo $_POST['visitor'] ?>
<br />
<font face="Arial, Helvetica, sans-serif" size="2" color="#993333">
Date of birth:</font>
<?php echo $_POST['dobday'] ?><?php echo $_POST['dobmonth'] ?><?php echo $_POST['dobyear'] ?>
<br/>
<font face="Arial, Helvetica, sans-serif" size="2" color="#993333">
Email: </font> <?php echo $_POST['visitormail'] ?>
<br/>
<br/>
<font face="Arial, Helvetica, sans-serif" size="2" color="#993333">
Subject: </font>
Repeat prescription request
<br /> <br/>
<font face="Arial, Helvetica, sans-serif" size="2" color="#993333">
Medication requested:</font><br />
<?php $notesout = str_replace("\r", "<br/>", $_POST['notes']);
echo $notesout; ?>
<br /><br/>
<font face="Arial, Helvetica, sans-serif" size="2" color="#993333">
IP: </font>
<?php echo $_POST['ip'] ?> </p>
<p></font></td>
</tr>