2

I'm making a simple email contact form for my website.

this is how the files are structured:

---- My_Website
         |
         |__ index.html
         |
         |__ assets
                |
                |__ email.php

in the index.html, I have a form with "POST":

<form role="form" action="assets/email.php" method="POST">
                    <div class="form-group">
                        <label class="sr-only" for="contact-email">Email</label>
                        <input type="text" name="email" placeholder="Email..." class="contact-email form-control" id="contact-email">
                    </div>
                    <div class="form-group">
                        <label class="sr-only" for="contact-subject">Subject</label>
                        <input type="text" name="subject" placeholder="Subject..." class="contact-subject form-control" id="contact-subject">
                    </div>
                    <div class="form-group">
                        <label class="sr-only" for="contact-message">Message</label>
                        <textarea name="message" placeholder="Message..." class="contact-message form-control" id="contact-message"></textarea>
                    </div>
                    <button type="submit" class="btn btn-success">Send</button>
</form>

in my php file, I just did a var_dump($_POST); and I'm very sure I write something in the input form, but it it returns me array(0) {}

frogLuan
  • 191
  • 1
  • 5
  • 11

1 Answers1

3

Change action="./assets/email.php" to action="assets/email.php"

Difster
  • 3,264
  • 2
  • 22
  • 32