Newbie for the life of me can't figure out where in contact.php you tell it where to send form?

Thx for any help.
I know it's got to be so obbvious.
Why would you send in php vs html?
<?php
if(!$_POST) exit;
$email = $_POST['email'];
//$error[] = preg_match('/\b[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b/i', $_POST['email']) ? '' : 'INVALID EMAIL ADDRESS';
if(!eregi("^[a-z0-9]+([_\\.-][a-z0-9]+)*" ."@"."([a-z0-9]+([\.-][a-z0-9]+)*)+"."\\.[a-z]{2,}"."$",$email )){
$error.="Invalid email address entered";
$errors=1;
if($errors==1) echo $error;
else{
$values = array ('name','email','message');
$required = array('name','email','message');
$your_email = "[email protected]";
$email_subject = "New Message: ".$_POST['subject'];
$email_content = "new message:\n";
foreach($values as $key => $value){
   if(in_array($value,$required)){
  if ($key != 'subject' && $key != 'company') {
    if( empty($_POST[$value]) ) { echo 'PLEASE FILL IN REQUIRED FIELDS'; exit; }
  $email_content .= $value.': '.$_POST[$value]."\n";
if(@mail($your_email,$email_subject,$email_content)) {
  echo 'Message sent!';
} else {
  echo 'ERROR!';
?>

Thanks. I'm working with different hosts and I guess thats where the confusion for me is coming in. In bluehost, I simply submit my form through form action to http://www.bluehost/bluemail. With the php form construction it 's form action is contact.php. Does this mean that the server I'm working with will uinderstand how to process contact.php and where to send it based on paramaters previously submitted? Or do I instruct the server via the php form? Thanks again
Date: Wed, 8 Feb 2012 13:50:11 -0700
From: [email protected]
To: [email protected]
Subject: Newbie for the life of me can't figure out where in contact.php you tell it where to send form?
    Re: Newbie for the life of me can't figure out where in contact.php you tell it where to send form?
    created by mhollis55 in Dreamweaver - View the full discussion
The reason why this is done in php is because php is server-side scripting. It's telling your server to do stuff. HTML doesn't tell your server anything, it tells the client (the web browser loading it) to do things. Only your server can send an email.
     Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/4194407#4194407
     To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/4194407#4194407. In the Actions box on the right, click the Stop Email Notifications link.
     Start a new discussion in Dreamweaver by email or at Adobe Forums
  For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746.

Similar Messages

Maybe you are looking for