Jump to content


Photo

whats wrong with my php?


  • Please log in to reply
2 replies to this topic

#1 empeee

empeee

    Young Padawan

  • Members
  • Pip
  • 4 posts

Posted 13 July 2010 - 08:51 PM

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

#2 rc69

rc69

    PHP Master PD

  • P2L Staff
  • PipPipPipPip
  • 3,827 posts
  • Gender:Male
  • Location:Here
  • Interests:Web Development

Posted 13 July 2010 - 09:36 PM

What error are you getting?

#3 empeee

empeee

    Young Padawan

  • Members
  • Pip
  • 4 posts

Posted 14 July 2010 - 10:58 AM

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.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users