Page 1 of 1

Having problems with 2 php mail pages

Posted: Sat Dec 03, 2011 2:05 pm
by aragaller
I have two pages and I am having problems with the mailing to my domain email. The first page here is where I fill in the information and then it takes me to the second page. Can someone tell me where the problem is this is the error I get when I try to submit I get this message on the second page. Please fill in all the required items. Please go back and try again.

--------------------------------------1st page--- getstarted.php
<h2>Order Form</h2>
<form action="getstarted-sucess.php" method="post">
<table>
<tr>
<td><p>Name *</p></td>
<td><input name="name" class="text" type="text"></td>
</tr>
<tr>
<td><p>Email Address *</p></td>
<td><input name="email" type="text"></td>
</tr>
<tr>
<td><p>Company Name *</p></td>
<td><input name="company" type="text"></td>
</tr>
<tr>
<td><p>Website URL</p></td>
<td><input name="website" type="text"></td>
</tr>
<tr>
<td></td>
<td><input style="cursor: pointer;" class="button green" type="submit" value="Sign Up"></td>
</tr>
</table>

--------------------------------------2nd page getstarted-success.php


<h2>Subscribing with <?php echo $site_option['site_name']; ?></h2>
<?php

if($_POST["name"] != null && $_POST["email"] != null && $_POST["company"] != null){
$to = $site_option['sales_email'];
$subject = "You Have a New Order!";
$body = "Name: ".$_POST["name"]."\nEmail: ".$_POST["email"]."\nSkype: ".$_POST["skype"]."\nCompany: ".$_POST["company"]."\nWebsite: ".$_POST["website"];
$headers = 'From: '.$_POST["email"];

if (mail($to, $subject, $body, $headers)) {
echo "<div style='padding: 10px; background-color: #cfebc9; border: 1px solid #60c748;'><p>Thank you! Your order was submitted successfully. Please use the PayPal link below to subscribe to our services so we can get your mobile web site setup for you.</p></div>";
echo '<br /><center>'.$site_option['paypal_link'].'</center>';
//create inset query
$query="INSERT INTO `customers` (`name`, `email`, `company`, `url`) VALUES ('".$_POST["name"]."', '".$_POST["email"]."', '".$_POST["company"]."', '".$_POST["website"]."')";
$result=mysql_query($query) or message_die('getstarted.php','MYSQL_QUERY',$query,mysql_error());

}
else {
echo "<div style='padding: 10px; background-color: #cfebc9; border: 1px solid #60c748;'><p>Something went wrong with the order. Please go <a href='getstarted.php'>back</a> and try again.</p></div>";
}
}
else {
echo "<div style='padding: 10px; background-color: #cfebc9; border: 1px solid #60c748;'><p>Please fill in all the required items. Please go <a href='getstarted.php'>back</a> and try again.</p></div>";
}

?>
</div>


I also am not getting any information from the echo $site_option
like the following

<div class="line"></div>
<p><strong>Address</strong>: <?php echo $site_option['address1']." ".$site_option['address2']; ?><br />
<strong>Telephone</strong>: <?php echo $site_option['phone']; ?><br />
<strong>E-mail</strong>: <a href="mailto:<?php echo $site_option['sales_email']; ?>"><?php echo $site_option['sales_email']; ?></a></p>
<?php echo $site_option['twitter_link']; ?></div>

Hope this isn't to long as this is my first post but I can't figure it out and hope someone here can.
Thank You