I am trying to collect my form inputs into a csv file and for some reason the csv file records some of the styling and does not display numbers (phone number and date). I am not sure where I got it wrong. Here is what I have so far.
<?php
$name = $_POST["name"];
$email = $_POST["email"];
$phone = $_POST["phone"];
$meeting_type = $_POST["meeting_type"];
$time = $_POST["time"];
$message = $_POST["message"];
$to = 'yahoo@gmail.com';
$subject = 'Contact Form Submission';
$v1 = "
<html>
<body>
<style>
h1 {color:#000066;}
table {border:1px solid black; background: #e3f0ff;}
</style>
<h1>Hello, this form has been submitted!</h1>
<img src= 'site.png' />
<table rules='all' style='border-color: #ffb300;' cellpadding='10' width='500px'>
<tr style='background: #ffb300;'><td><strong>First Name:</strong> $name</td>
<tr style='background: #fafafa;'><td><strong>Email:</strong> $email</td>
<tr style='background: #fafafa;'><td><strong>Phone:</strong> $phone</td>
<tr style='background: #fafafa;'><td><strong>Reason for Contact:</strong> $meeting_type</td>
<tr style='background: #fafafa;'><td><strong>Best Time to Contact:</strong> $time </td>
<tr style='background: #fafafa;'><td><strong>Comments:</strong> $message</td>
</table>
</body>
</html> ";
$message = $v1;
$headers = "From: $from\r\n";
$headers .= "Content-type: text/html\r\n";
mail($to, $subject, $message, $headers);
echo "Message has been sent..."; //Page RE DIRECT
echo $v1;
//******************************************************************************************************************************//
$name = $_POST["name"];
$email = $_POST["email"];
$phone = $_POST["phone"];
$phone = $_POST["phone"];
$meeting_type = $_POST["meeting_type"];
$time = $_POST["time"];
$message = $_POST["message"];
$subject = 'Message Confirmed!';
$v1 = "
<html>
<body>
<style>
#disclosure {font-size: 8px; color: #333;}
h1 {color:#000066;}
table {border:1px solid black;}
</style>
<img src= 'site.png' />
<table rules='all' style='border-color: #ffb300;' cellpadding='10' width='500px'>
<tr style='background: #ffb300;'><td><strong>Email Confirmation</strong>
<tr style='background: #fafafa;'><td>Hello <strong> $name</strong>, your message has been recieved! We will contact you shortly! <br><br>Best, <br>Me<br>An awesome person<br><br>Follow Us On:<br><a href='http://www.facebook.com'><img src='facebook_hover.png' width='18' height='18'></a><a href='http://twitter.com'><img src='twitter_hover.png' width='18' height='18'></a><a href='http://google.com'><img src='gplus_hover.png' width='18' height='18'></a><br><div id='disclosure' align='right'>©me™ All Rights Reserved 2014-2014 </div>
</table>
</body>
</html> ";
$message = $v1;
$headers = "From: $from\r\n";
$headers .= "Content-type: text/html\r\n";
mail($email, $subject, $message, $headers);
$count= count(file("main_form.csv"));
$today = date("d M Y h:i A");
echo $today;
echo $v1;
$cvsData = "\n" . $count . "," . $today . "," . $name . "," . $email . "," . $phone . "," . $meeting_type . "," . $time . "," . $message;
$fp = fopen("main_form.csv", "a" );
if($fp){
fwrite($fp, $cvsData);
fclose($fp);
}
?>