Create an HTML form that works for the following php file. Email $formEmailAddress "; echo "Topic $formTopic "; ?> contact form response...





Create an HTML form that works for the following php file.







   $formEmailAddress = $_POST['email'];   //pull email address from the form data
   $formTopic = $_POST['topic'];           //pull topic from the form data

   echo "


Email $formEmailAddress

";
   echo "

Topic $formTopic

";


?>








contact form response

#container {
           width: 800px;
           border: 1px solid black;
           padding: 10px;
           margin: 10px auto;
           }
.colorRed {
   color: #F00;
}




















echo "


This page was created by PHP on the server and sent back to your browser.

";


//It will create a table and display one set of name value pairs per row
   echo "

";
   echo "";
   foreach($_POST as $key => $value)
   {
       echo '';
       echo '';
       echo '';
       echo "";
   }
   echo "










Field NameValue of field
',$key,'',$value,'
";
   echo "

";


   $toEmail = "email";       //will send the email to the email address entered on the form


   $subject = "Thank you for your message. I will contact you soon.";   //This is the message that will be sent back to the person who sent you a message from your contact form.



   $fromEmail = "address";




   $emailBody = "Form Data\n\n ";
   foreach($_POST as $key => $value)
   {
       $emailBody.= $key."=".$value."\n";   //Adds the name value pairs to the body of the email, each one on their own line
   }

   echo "


$emailBody

";

   $headers = "From: $fromEmail" . "\r\n";               //Creates the From header with the appropriate address


    if (mail($toEmail,$subject,$emailBody,$headers))    //puts pieces together and sends the email to your hosting account's smtp (email) server
   {
        echo("


Message successfully sent!

");
   }
   else
   {
        echo("

Message delivery failed...

");
   }


?>







Jun 09, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here