I've recently been redesigning my contact form on my website. I will be using php to generate two separate emails--one will be a confirmation email sent to the customer, and the second email will be to me. This way, I can include the form details in the customer's confirmation, allowing them to verify that they entered the correct info. There's one relatively minor detail I'm trying to iron out.
My html form has a couple drop down selectors and the labels I've always used, which post to the php end, are shorthand that are okay for me, but not necessarily great for a customer facing email. I could edit the labels on the html side to be more customer friendly, but it's not ideal. I'd like to convert each shorthand string into two new strings, one for the customer email and one for when the form is sent to me.
For example, one of these drop downs asks whether the customer wants my all day availability, or only partial day availability. Currently they post "fullday" or "partial" to the php.
I'm thinking that a simple if/else function would be effective to define a new string. If you can excuse my lack of sytnax here, I'm thinking something along the lines of
if($availability = "fullday") {
$lead_av = "You would prefer my exclusive availability for your event date.";
} else {
$lead_av = "You don't mind if I have another event on the same day as long as there is plenty of time between them.";
}
I don't need these long statements when I receive the form, and would prefer my own copy of the form be something that I can consume in less than 2 seconds (which the shorthand allows me to do). Down the road, I want to reduce my copy of the form even more to render simple "1, 2, 3" codes, hopefully allowing me to extract the form data easily in a way that will let me import many forms elsewhere, all at once.
As you may be able to tell from this example, my understanding of php (or coding in general) is not exactly sophisticated. Appreciate any recommendations.
if($availability = "fullday")You want to use the comparison operator==here instead.