EMAIL ISSUE...CONTACT.PHP

Hello, i need help with my flash website…the button is working but I think there is a problem in the contact.php

Could someone help me figure out if there is a syntax issue?
the website is functioning www.KirkPhylles.com

Thanks you so much
kirk

<?php $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; if(empty($_POST['php_mail'])){ //echo"no email address found"; echo "retval=0"; exit; } $senderName = $_POST['php_name']; $senderEmail = $_POST['php_mail']; $senderMsg = nl2br($_POST['php_message']); $sitename = "http://shuhanarts.com"; $to = "[email protected]"; $ToName = "shuhankuang"; $date = date("m/d/Y H:i:s"); $ToSubject ="Message from $sitename"; $comments = $msgPost; $EmailBody = "A visitor to $sitename has left the following information
Sent By: $senderName, Email : $senderEmail

Message Sent:
$senderMsg
"; $EmailFooter = "
Sent: $date

"; $Message = $EmailBody.$EmailFooter; $ok = @mail($to, $ToSubject, $Message, $headers . "From:$senderName"); if($ok){ echo "retval=1"; }else{ echo "retval=0"; } ?>

pasting the php into the forum isn’t ideal. You should be sure to use the forum’s own php tag. That way it’s colored (and the formatting/spacing won’t get messed up) and easier to study the syntax.

oops thank you I never done that before will do now :slight_smile:

[php]<?php
$headers = “MIME-Version: 1.0\r\n”;
$headers .= “Content-type: text/html; charset=iso-8859-1\r\n”;
if(empty($_POST[‘php_mail’])){
//echo"no email address found";
echo “retval=0”;
exit;
}
$senderName = $_POST[‘php_name’];
$senderEmail = $_POST[‘php_mail’];
$senderMsg = nl2br($_POST[‘php_message’]);
$sitename = “http://shuhanarts.com”;
$to = "[email protected]";
$ToName = “shuhankuang”;
$date = date(“m/d/Y H:i:s”);
$ToSubject =“Message from $sitename”;
$comments = $msgPost;
$EmailBody = “A visitor to $sitename has left the following information

Sent By: $senderName, Email : $senderEmail



Message Sent:

$senderMsg
”;
$EmailFooter = “
Sent: $date

”;
$Message = $EmailBody.$EmailFooter;
$ok = @mail($to, $ToSubject, $Message, $headers . “From:$senderName”);
if($ok){
echo “retval=1”;
}else{
echo “retval=0”;
}

?>[/php]

by the way…I would like to put my email address : [email protected] and my name is Kirk Phylles and it doesnt work…i bought this template online and replace the email and address, still wont work…thanks for responding!

Kirk

Since you were so quick to respond, I figure I’ll ask another question. If the button works, as you said, how do you know there is a problem? Is there an error message of any sort? Do you simply not receive the email?

Also, if you changed the email address in the code to your own email address, then please post the updated PHP. Maybe you accidentally inserted something that wasn’t supposed to be. If so, we can’t see it. Make sure you give the most recent code.

when I push the button, it replied…message sent.
if you have time you can check the web www.kirkphylles.com contact button…
i am pretty sure its the php file…

[php]<?php
$headers = “MIME-Version: 1.0\r\n”;
$headers .= “Content-type: text/html; charset=iso-8859-1\r\n”;
if(empty($_POST[‘php_mail’])){
//echo"no email address found";
echo “retval=0”;
exit;
}
$senderName = $_POST[‘php_name’];
$senderEmail = $_POST[‘php_mail’];
$senderMsg = nl2br($_POST[‘php_message’]);
$sitename = “http://kirkphylles.com”;
$to = "[email protected]";
$ToName = “kirk”;
$date = date(“m/d/Y H:i:s”);
$ToSubject =“Message from $sitename”;
$comments = $msgPost;
$EmailBody = “A visitor to $sitename has left the following information

Sent By: $senderName, Email : $senderEmail



Message Sent:

$senderMsg
”;
$EmailFooter = “
Sent: $date

”;
$Message = $EmailBody.$EmailFooter;
$ok = @mail($to, $ToSubject, $Message, $headers . “From:$senderName”);
if($ok){
echo “retval=1”;
}else{
echo “retval=0”;
}

?>[/php]

hmm… I’m pretty new at PHP, and I can’t see a problem. I don’t think it’s as simple as a missing bracket or semi colon, because it looks good to me (I could be wrong). If you’re hosting the site yourself sometimes there are issues with emailing yourself I think. So it’s best if someone else tries to send you an email. I sent you one. My name was Test. My email was [email protected] or something like that, and my message was Test. It said the message was sent. Did you receive it?

If not then I’m afraid I won’t be able to solve this one. The good news is that now by providing so much more information about your problem, someone with more experience should have an easier time answering it if they come online.

Good luck.

so sooooorry there was a missing file, there were two parts to the contact.swf file, forgot to upload the other one on the server! Ooops so sorry ???

Sponsor our Newsletter | Privacy Policy | Terms of Service