-1

So I have made a contact page in modx with this code

<!-- Start Contact Form -->


<div id="contact-form" class="contatct-form">
    <div class="loader"></div>
    <form action="mail.php" class="contactForm" name="cform" method="post">
    <div class="row">

I have also uploaded the mail.php file into assets but it still doesn't seem to work. So far I tried path/to/assets/mail.php which didn't work either.

Any help would be appreciated

curveball
  • 4,320
  • 15
  • 39
  • 49
admin24
  • 5
  • 1
  • 2
    Where's the php file? – aldrin27 Aug 25 '15 at 09:07
  • 1
    What do you mean "doesn't seem to work"? – raduation Aug 25 '15 at 09:08
  • Please dump `mail.php` and any error you get. – D4V1D Aug 25 '15 at 09:09
  • Are you sure the mail.php is on the same request level? This form will submit its contents to `where you are now/mail.php` – Xyv Aug 25 '15 at 09:09
  • when you said that you tried "path/to/assets/mail.php" did you try physical path on drive or web path to that file? The form must use web path. Best way to work this out is to put some echo on top of your mail.php and see if you get to it when pressing the submit button. If not there can be 3 reasons: 1) your path in action is not correct. 2) you submit button is not submitting the form (faults in html layout) 3) some javascript is blocking the default action of submit button. – Auris Aug 25 '15 at 09:16

2 Answers2

1

Try to Change your form action as following path look like ..assets/example.php

 <div id="contact-form" class="contatct-form">
                        <div class="loader"></div>
                        <form action="..yourpath/mail.php" class="contactForm" name="cform" method="post">
                            <div class="row">
Saravanan Arunagiri
  • 585
  • 1
  • 5
  • 27
1

This isnt "modx-way". Here simple example https://rtfm.modx.com/extras/revo/formit/formit.tutorials-and-examples/formit.examples.simple-contact-page how it should be.

Vasis
  • 2,281
  • 1
  • 16
  • 23