Hi,
My developer got sick and now I’m left with a form I don’t really know how to complete. He did finish one form, which has now grown much longer, and I thought I could try just adding to it, but that doesn’t seem to be the case… If anyone could help I’d really appreciate it, thought I’d try and figure it out myself before I go knocking down his hospital room door…
The form is suppose to return all the fields and in the subject line have "health questionnaire name from form. Now it only returns 3 fields, and in the subject line it says "health questionnaire info from field above email. I can’t see anywhere where it is set to return only 3 fields, but I am pretty clueless, and I don’t know what to do anymore.
I added in dobirth, age and gender.
\n"); } public function set_Message() { if(empty($_POST['message'])) { $_POST['message']=""; } $this->_message = $_POST['message']; } /*========================================================*/ /*========================================================*/ /*========================================================*/ public function __construct() { $this->set_Name(); $this->set_Dobirth(); $this->set_Age(); $this->set_Gender(); $this->set_Email(); $this->set_Phone(); $this->set_Message(); } public function HealthMod() { echo ''; echo 'Name :
'; echo 'Date of Birth :
'; echo 'Age :
'; echo 'Gender :
'; echo 'Email :
'; echo 'Phone :
'; echo 'Message :
'; echo ''.$_POST['message'].'
'; echo ''; echo ''; } private function MsgConstruct() { $body = $this->get_Name().'
'. $this->get_Phone().'
'. $this->get_dobirth().'
'. $this->get_Age().'
'. $this->get_Gender().'
'. $this->get_Message(); return $body; } private function EmailContact() { if (isset($_POST['send'])) { if($this->checkEmail($this->get_Email())==FALSE) { $this->_error['emailA']='This email address is invalid'; } else { $headers = 'From: '.$this->get_Email()."\r\n"; $headers .= 'MIME-Version: 1.0'."\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1'."\r\n"; $to='[email protected]'; $subject='Health Questionnaire '.$this->get_Name(); if (mail($to, $subject, $this->msgConstruct(), $headers)) { echo ''; } else { echo ''; } } } } public function __destruct() { } } ?>
///////////////////////////////////////////////
I dunno if its important but this is the validate that was also linked
<?php class Validate { public static $emailPattern = '/^([\w\!\#$\%\&\'\*\+\-\/\=\?\^\`{\|\}\~]+\.)*[\w\!\#$\%\&\'\*\+\-\/\=\?\^\`{\|\}\~]+@((((([a-z0-9]{1}[a-z0-9\-]{0,62}[a-z0-9]{1})|[a-z])\.)+[a-z]{2,6})|(\d{1,3}\.){3}\d{1,3}(\:\d{1,5})?)$/i'; public static $numPattern = '/[^0-9]*/'; /*===================== Accessor Methods =====================*/ /*========================================================*/ /*========================================================*/ /*========================================================*/ public function sanitizeNumber($num) { return preg_replace(self::$numPattern,'', $num); } public function sanitizePhone($phone) { $cleanPhone=$this->sanitizeNumber($phone); if(strlen($cleanPhone)>10) { return FALSE; } else { return TRUE; } } public function checkEmail($email) { if (preg_match(self::$emailPattern, $email)) { return TRUE; } else { return FALSE; } } } ?>