i have a simple contact form with fields Name Email Message Submit button here at http://www.paktech.co.cc/p/contact.html Action Script is hosted at a different server and domain <?php // Contact subject $subject ="$subject"; // Details $message="$detail"; // Mail of sender $mail_from="$customer_mail"; // From $header="from: $name <$mail_from>"; // Enter your email address $to ='someone@somewhere.com'; $send_contact=mail($to,$subject,$message,$header); // Check, if message sent to your email // display message "We've recived your information" if($send_contact){ echo "We've recived your contact information"; } else { echo "ERROR"; } ?> PHP: above is the action script i can not host both files on same server because input form is hosted at blogger any one can help how i retrieve data in above script submitted from blogger i tested it with <form name="form1" method="post" action="http://www.domain.com/send_contact.php"> PHP: but in this case email comes blank with unknown sender any help will be appreciated Regards
Does this particular .php code help to boost search engine rankings for a website? I've been hearing alot lately about the power of RSS feeds and how powerful .php scripting is for search engine traffic, and would like to get extra insight from someone about it...
Do any of your fields transfer any data from the form? Try instead of using $subject ="$subject"; try $subject=$_POST['subject']; Register globals is probably disabled (AND SHOULD BE) and you need to get the value directly from the $_POST superglobal variable. $subject=$subject is just setting an undefined variable equal to an undefined variable.
I am thankful to you sir it really works <?php // Contact subject $subject=$_POST['subject']; // Details $message=$_POST['detail']; // Mail of sender $mail_from=$_POST['customer_mail']; // From $header=$_POST['mail_from']; $header=$_POST['name']; // Enter your email address $to ='example@example.com'; $send_contact=mail($to,$subject,$message,$header); // Check, if message sent to your email // display message "We've recived your information" if($send_contact){ echo "We've recived your contact information"; } else { echo "ERROR"; } ?> PHP: please check i am receiving email from Server email address not from input please how i fix this now i have only issue with sender email address
if you see on the code above: you are assigning to values to the same variable. and the last value assigned is the one that the variable will hold for the rest of the scrip. change this: $header=$_POST['mail_from']; $header=$_POST['name']; PHP: For this: $header='From:'.$_POST['mail_from']; $headerName = $_POST['name']; PHP: and this: $send_contact=mail($to,$subject,$message,$header); PHP: for this: $send_contact=mail("$to","$subject,"$message","$header"); PHP: try it ~Mike