←  Programming and General Web Design

Pixel2Life Forum

»

whats wrong with my php?

empeee's Photo empeee 13 Jul 2010

so im trying to make a simple contact form for my portfolio, and everything seems to be right, but i keep getting an error.

code for the form:

<table width="96%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><div align="left">
<form id="form1" name="form1" method="post" action="send_contact.php">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="2">Contact Form</td>
</tr>
<tr>
<td width="19%" valign="top">Name:<br /></td>
<td width="81%" valign="top"><p>
<label for="name"></label>
<input name="name" type="text" id="name" size="25" />
</p>
<p><br />
</p></td>
</tr>
<tr>
<td valign="top">Email:</td>
<td valign="top"><p>
<input name="customer_email" type="text" id="customer_email" size="25" />
</p>
<p>&nbsp; </p></td>
</tr>
<tr>
<td valign="top">Subject:</td>
<td valign="top"><p>
<label for="subject"></label>
<select name="subject" id="subject">
<option selected="selected">Choose a Subject</option>
<option>Request a Quote</option>
<option>Question/Concern</option>
<option>Testimonial Submission</option>
<option>Other</option>
</select>
</p>
<p>&nbsp; </p></td>
</tr>
<tr>
<td valign="top">Additional Information:<br /></td>
<td valign="top"><p>
<label for="information"></label>
<textarea name="information" id="information" cols="45" rows="5"></textarea>
</p>
<p>&nbsp; </p></td>
</tr>
<tr>
<td>&nbsp;</td>
<td><input type="submit" name="button" id="button" value="Submit"/>
<input type="reset" name="button2" id="button2" value="Reset" /></td>
</tr>
</table>
</form>
</div></td>
</tr>
</table>


php code

<?php

// Contact Name
$name="$name";
// Contact Email
$email="$customer_email";
// Contact subject
$subject="$subject";
// Additional Information
$information="$information";

// Mail of sender
$mail_from="$customer_email";
// From
$header="from: $name <$mail_from>";

// Enter your email address
$to ='[email protected]';

$send_contact=mail($to,$name,$customer_email,$subject,$information);

// Check, if message sent to your email
// display message "We've recived your information"
if($send_contact){
echo "Your email has been sent sucessfully!";
}
else {
echo "ERROR";
}
?>


i cant seem to find my error
Quote

rc69's Photo rc69 13 Jul 2010

What error are you getting?
Quote

empeee's Photo empeee 14 Jul 2010

its just telling me im getting an error, the php echo "ERROR". all the field names match up and no syntax errors are present either.
Quote