How do I get my forms to work and receive replies
Hi,
I am having a major problem getting my email forms to work via my server my website Registration and Contact pages are both constructed in Dreamweaver CC using the FormMail Post method code. The server I'm using is Crazy Domains to host my site. They do have php available. I have a php file in their cgi-bin folder to work the backend but this file may not be configured correctly as I keep receiving the 500 error codes when I test sending the form from my website via internet. I was hoping someone will be able to help me get my forms working properly to receive the enquiries to my emails inbox. I'm using a MacBook pro mid 2012 which handles the Dreamweaver program nicely. Website pages: www.reikiempowermentseminars.com.au/assets/contact.html www.reikiempowermentseminars.com.au/assets/registration.html
Here is the code I'm using for the post form method.
<form action=https://www.reikiempowermentseminars.com.au/cgi-bin/testemail-1.php
method="post" onsubmit="processForm(this);return false" name="enroll" id="enroll"><div id="treatmentcontact" class="fluid">
<div><input name="recipient" type="hidden" id="recipient" value="dezdalton@reikiempowermentseminars.com.au" />
<input type="hidden" name="subject" id="subject" value="REIKI TREATMENT ENQUIRY" />
<input name="redirect" type="hidden" id="redirect" value="https://www.reikiempowermentseminars.com.au/assets/thankyoupage.html" /></div>
The php file in the cig-bin/testemail-1.php is on the cpanel remote server.
Here's the php code
<?php
// THE BELOW LINE STATES THAT IF THE SUBMIT BUTTON
// WAS PUSHED, EXECUTE THE PHP CODE BELOW TO SEND THE
// MAIL. IF THE BUTTON WAS NOT PRESSED, SKIP TO THE CODE
// BELOW THE "else" STATEMENT (WHICH SHOWS THE FORM INSTEAD).
if ( isset ( $_POST [ 'buttonPressed' ] )){
// REPLACE THE LINE BELOW WITH YOUR E-MAIL ADDRESS.
$to = 'dezdalton@reikiempowermentseminars.com.au' ;
$subject = 'From PHP contact page' ;
// NOT SUGGESTED TO CHANGE THESE VALUES
$message = $_POST [ "message" ] ;
$headers = 'From: ' . $_POST[ "from" ] . PHP_EOL ;
mail ( $to, $subject, $message, $headers ) ;
// THE TEXT IN QUOTES BELOW IS WHAT WILL BE
// DISPLAYED TO USERS AFTER SUBMITTING THE FORM.
echo "Your e-mail has been sent! You should receive a reply within 24 hours!" ;}
else{
?>
<form method= "post" action= "<?php echo $_SERVER [ 'PHP_SELF' ] ;?>" />
<table>
<tr>
<td>Your e-mail address: </td>
<td><input name= "from" type= "text"/></td>
</tr>
<tr>
<td>Your message: </td>
<td><textarea name= "message" cols= "20" rows= "6"></textarea></td>
</tr>
<tr>
<td></td>
<td><input name= "buttonPressed" type= "submit" value= "Send E-mail!" /></td>
</tr>
</table>
</form>
<?php } ?>
Please advise if there is something missing or not configured correctly here.
Thanks for your kind help and assistance. Dez
