<!-- Start Contact Form --> <div id="contact-form" class="contact-form"> <div class="loader"></div> <form action="mail.php class="contactForm" name="cform" method="post"> <div class="row">
action="mail.php
action="path/to/assets/mail.php"
Hey Guys,
So I have a contact page that links to mail.php which i have uploaded into a folder in assets but i cannot get that and my html to link, heres a snippet of how the code looks like on my contact page/form<!-- Start Contact Form --> <div id="contact-form" class="contact-form"> <div class="loader"></div> <form action="mail.php class=" contactform"="" name="cform" method="post"> <div class="row">
Is there any way for me to link that back to the mail.php file in order for the contact form to work ?
any help would be much appreciated
thanks!</div></form></div>
<form action="mail.php" class="contactform"="" name="cform" method="post">
Quote from: admin24 at Aug 24, 2015, 10:32 AMstill doesnt seem to work, could it be the php file ?Hey Guys,
So I have a contact page that links to mail.php which i have uploaded into a folder in assets but i cannot get that and my html to link, heres a snippet of how the code looks like on my contact page/form<!-- Start Contact Form --> <div id="contact-form" class="contact-form"> <div class="loader"></div> <form action="mail.php class=" contactform"="" name="cform" method="post"> <div class="row">
Is there any way for me to link that back to the mail.php file in order for the contact form to work ?
any help would be much appreciated
thanks!</div></form></div>
Your missing the ending " after the form action, should be:
<form action="mail.php" class="contactform" =""="" name="cform" method="post">
</form>
Hi,I have tried that, it didnt seem to work, the page doesnt load at all after clicking submit, heres the php could there be something wrong with this ?
you have to changeintoaction="mail.phpand don't forget the " at the end.action="path/to/assets/mail.php"
By the way you can use plugins like FormIT to handle contact forms in MODX.
<?php // declare our variables $name = $_POST['name']; $email = $_POST['email']; $message = nl2br($_POST['message']); // set a title for the message $subject = "Message from Your Website"; $body = "From $name, \n\n$message"; $headers = 'From: '.$email.'' . "\r\n" . 'Reply-To: '.$email.'' . "\r\n" . 'Content-type: text/html; charset=utf-8' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); // put your email address here mail("*****@gmail.com", $subject, $body, $headers); ?> <!--Display a thankyou message in the callback --> <div class="mail_response"> <h4>Thank you <?php echo $name ?>!</h4> <p>We'll be in touch real soon!</p> </div>
Have you looked at SPForm to see if it meets your needs? It will set almost everything up for you.I attempted to use it but struggled a little but, im giving formIT a go but not too sure how to go about it, thanks