PHP Question

Synobun

Deity
Joined
Nov 19, 2006
Messages
24,884
Alright, so here's the deal.
I want a contact form to appear in a javascript window when a person clicks on an image, right?

Well, it doesn't work. The window opens up just fine, but I'm faced with this:

"Parse error: syntax error, unexpected $end in /home/powertms/public_html/getthepower/contact.php on line 46"

My code is:

Code:
<?php 
if ($_POST["email"]<>'') { 
	$ToEmail = 'youremail@site.com'; 
	$EmailSubject = 'Site contact form '; 
	$mailheader = "From: ".$_POST["email"]."\r\n"; 
	$mailheader .= "Reply-To: ".$_POST["email"]."\r\n"; 
	$mailheader .= "Content-type: text/html; charset=iso-8859-1\r\n"; 
	$MESSAGE_BODY = "Name: ".$_POST["name"]."<br>"; 
	$MESSAGE_BODY .= "Email: ".$_POST["email"]."<br>"; 
	$MESSAGE_BODY .= "Comment: ".nl2br($_POST["comment"])."<br>"; 
	mail($ToEmail, $EmailSubject, $MESSAGE_BODY, $mailheader) or die ("Failure"); 
?> 
Your message was sent
<?php 
} else { 
?> <form action="contact.php" method="post"> 
<table width="400" border="0" align="center" cellpadding="0" cellspacing="2"> 
<tr> 
<td width="29%" class="bodytext">Your name:</td> 
<td width="71%"><input name="name" type="text" id="name" size="32"></td> 
</tr> 
<tr> 
<td class="bodytext">Email address:</td> 
<td><input name="email" type="text" id="email" size="32"></td> 
</tr> 
<tr> 
<td class="bodytext">Comment:</td> 
<td><textarea name="comment" cols="45" rows="6" id="comment" class="bodytext"></textarea></td> 
</tr> 
<tr> 
<td class="bodytext">&nbsp;</td> 
<td align="left" valign="top"><input type="submit" name="Submit" value="Send"></td> 
</tr> 
</table> 
</form>

Can somebody tell me what's wrong? :S
 
Back
Top Bottom