PHP virgin in need of help

l
My question is this:

Where am I going wrong with my HTML code for the following:

<div>
<label for=“pAccess”>Property Access</label>
<select name=“pAccess” id=“pAccess”>
<option value=“”></option>
<option value=“hKey”>Have keys call contact</option>
<option value=“pEmpty”>Have keys property empty</option>
<option value=“wNotify”>Will notify you when we have the keys</option>
<option value=“oAgent”>Other agent has keys call contact</option>
</select>
</div>

Im testing sending a form at the moment online but all Im receiving via email is the values “value”, this is obviously a very silly mistake but one Im unsure to get my head around, and Id imagine it can be corrected fairly simply.

Example email Im being sent - I select on the form “have keys call contact”, but Im being sent hkey.

Anybody that wants my PHP code please get back in touch

Look forward to hearing from anyone

Post the php code here.

You will only be sent the value by your form, so hKey is right. There’s nothing stopping you detecting this value in your code though and substituting it with a more friendly message.

Ive used a PHP generator then manipulated it to add all my additional fields into the form.I could do with telling whats actually needed in this code and what isnt, as to get rid of code bloat.

$bName_is_required = 0;
$title_is_required = 0;
$fName_is_required = 0;
$lName_is_required = 0;
$custAddress_is_required = 0;
$custCityAndCount_is_required = 0;
$custPostC_is_required = 0;
$tDay_is_required = 0;
$tEve_is_required = 0;
$eMail_is_required = 0;
$aNumRdTwn_is_required = 0;
$cAndC_is_required = 0;
$propPostC_is_required = 0;
$pAccess_is_required = 0;
$contact_is_required = 0;
$cName_is_required = 0;
$cTDay_is_required = 0;
$cTEve_is_required = 0;
$bedrooms_is_required = 0;
$floorplan_is_required = 0;
$output_is_required = 0;
$otherInfo_is_required = 0;
$terms_is_required = 0;

$uself = 0;
$forcelf = 0;
$use_envsender = 0;
$use_sendmailfrom = 0;
$smtp_server_win = ‘’ ;
$use_webmaster_email_for_from = 0;
$use_utf8 = 1;
$my_recaptcha_private_key = ‘’ ;

// -------------------- END OF CONFIGURABLE SECTION ---------------

define( ‘MAX_LINE_LENGTH’, 998 );
$headersep = $uself ? "
" : "\r
" ;
$content_nl = $forcelf ? "
" : (defined(‘PHP_EOL’) ? PHP_EOL : "
") ;
$content_type = $use_utf8 ? ‘Content-Type: text/plain; charset=“utf-8”’ : ‘Content-Type: text/plain; charset=“iso-8859-1”’ ;
if ($use_sendmailfrom) {
ini_set( ‘sendmail_from’, $mailto );
}
if (strlen($smtp_server_win)) {
ini_set( ‘SMTP’, $smtp_server_win );
}
$envsender = “-f$mailto” ;
$company = $_POST[‘company’];
$title = $_POST[‘title’] ;
$fName = $_POST[‘fName’];
$lName = $_POST[‘lName’];
$custAddress = $_POST[‘custAddress’];
$custCityAndCount = $_POST[‘custCityAndCount’];
$custPostC = $_POST[‘custPostC’];
$tDay = $_POST[‘tDay’];
$tEve = $_POST[‘tEve’];
$eMail = $_POST[‘eMail’];
$aNumRdTwn = $_POST[‘aNumRdTwn’];
$cAndC = $_POST[‘cAndC’];
$propPostC = $_POST[‘propPostC’];
$pAccess = $_POST[‘pAccess’];
$contact = $_POST[‘contact’];
$cName = $_POST[‘cName’];
$cTDay = $_POST[‘cTDay’];
$cTEve = $_POST[‘cTEve’];
$bedrooms = $_POST[‘bedrooms’];
$floorplan = $_POST[‘floorplan’];
$output = $_POST[‘output’];
$otherInfo = $_POST[‘otherInfo’];
$terms = $_POST[‘terms’];

if (empty($email)) {
$email = $mailto ;
}
$fromemail = $use_webmaster_email_for_from ? $mailto : $email ;

if (function_exists( ‘get_magic_quotes_gpc’ ) && get_magic_quotes_gpc()) {
$comments = stripslashes( $comments );
}

$messageproper =
“This message was sent from:” . $content_nl .
“$http_referrer” . $content_nl .
“-------------------------Clients Contact Details--------------------------------” . $content_nl .
“Company name: $company” . $content_nl .
“Clients Title: $title” . $content_nl .
“Clients First Name: $fName” . $content_nl .
“Clients Last Name: $lName” . $content_nl .
“Clients Address: $custAddress” . $content_nl .
“Clients City or County: $custCityAndCount” . $content_nl .
“Clients Post Code: $custPostC” . $content_nl .
“Clients Daytime Phone Number: $tDay” . $content_nl .
“Clients Evening Phone Number: $tEve” . $content_nl .
“Clients E-mail Address: $email” . $content_nl .
“------------------Details of Property Requiring EPC-------------------------------” . $content_nl .
“Properties Address: $aNumRdTwn” . $content_nl .
“Properties City or County: $cAndC” . $content_nl .
“Properties Post Code: $propPostC” . $content_nl .
“Property Access: $pAccess” . $content_nl .
“Contact is: $contact” . $content_nl .
“Contact Name: $cName” . $content_nl .
“Contacts Daytime Phone Number: $cTDay” . $content_nl .
“Contacts Evening Phone Number: $cTEve” . $content_nl .
“Number of Bedrooms: $bedrooms” . $content_nl .
“Is a floorplan required: $floorplan” . $content_nl .
“EPC Total Price: $output” . $content_nl .
“------------------------- Other Information -------------------------” . $content_nl . $content_nl .
wordwrap( $otherInfo, MAX_LINE_LENGTH, $content_nl, true ) . $content_nl . $content_nl .
“------------------------------------------------------------” . $content_nl ;

$headers =
“From: \”$company\" <$fromemail>" . $headersep . “Reply-To: \”$company\" <$email>" . $headersep . “X-Mailer: chfeedback.php 2.16.2” .
$headersep . ‘MIME-Version: 1.0’ . $headersep . $content_type ;

if ($use_envsender) {
mail($mailto, $subject, $messageproper, $headers, $envsender );
}
else {
mail($mailto, $subject, $messageproper, $headers );
}
header( “Location: $thankyouurl” );
exit ;

?>

Hi Anthony,

So if I get this right… I can put the same value/message in the value as compared to what is displayed to the user, so in my example above have the value = “have keys call contact” is this ethically ok or is there an alternative or better solution ?

cheers

Ben