Some of my clients decide to use $ signs before entering a numeric value.
This is fine however the form that gets filled out does a calculation at the end and posts the results via email submission.
When the customer uses the "$" symbol, the calculations do not work and I end up with a "0".
How can I correct this issue to ignore the "$" or restrict them from trying to use it??
here is my code, i will spare you the redundancies:
Code: Select all
<?php
include('class.Email.php');
$total_contents .= "Groceries/Supplies: " . $_POST['GroceriesSupplies'] . "\n\n";
$total_contents .= "Day Care: " . $_POST['DayCare'] . "\n\n";
$total_contents .= "Medical: " . $_POST['Medical'] . "\n\n";
$total_contents .= "*******Total Expenses******* " . "\n\n";
$total_contents .= "TOTAL EXPENSES: " . $_POST['GroceriesSupplies'] +(int)$_POST['DayCare']+(int)$_POST['Medical']. "\n\n";
//echo $total_contents ;
$to="email@email.com";
$subject="Form submission";
$notify_subject = "Form Submission";
$from = "email@email.com";
$notify_message = "There has been a feedback";
$visitor_message = "Thanks for writing to us. We will get back to you at the earliest.
Hoping of a long term business relationship with you.
";
mail( "email@email.com", "$notify_subject", "$total_contents", "$from");
//mail( "$to", "$notify_subject", "$total_contents", "$from");
header("Location:thank-you.html");
exit();
?>