Quantcast
Channel: Adobe Community: Message List - PHP Contact Form Help
Viewing all articles
Browse latest Browse all 13

PHP Contact Form Help

$
0
0

I am trying to link a contact form on my website with my email address, as well as have it direct me to an already created thank you page upon submission. I have followed numerous PHP coding tutorials, but no matter what I try when I click the "submit" button to test it out the page just redirects to the text of my .php file and doesn't email the form to me. I'm not sure if it's a problem with the way the php is coded or with the action on the form itself. Please help! This is what shows up when I click submit (for the code I've most recently tried, without trying to connect to the thank you page):

 

<?php

 

/* Subject and Email Variables */

 

$emailSubject = 'Participant Contact Form';

$webMaster = 'xxx@xxx.com';

 

/* Gathering Data Variables */

 

$nameField = $_POST('name');

$ageField = $_POST('age');

$phoneField = $_POST('phone');

$emailField = $_POST('email');

 

$body = <<<EOD

<br><hr><br>

Name: $name <br>

Child Date of Birth: $age <br>

Phone Number: $phone <br>

Email: $email <br>

EOD;

 

$headers = "From: $email\r\n";

$headers .= "Content-type: text/html\r\n";

$success = mail($webMaster, $emailSubject, $body, $headers);

 

?>


Viewing all articles
Browse latest Browse all 13

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>