0

Cannot POST app. php

I am trying to get sent all the info that users insert in the form of the website, to my email. Post method is not working for me. Could it be a configuration problem? I configured php using XAMMP, and i have running both APACHE and MYSQL when i am executing the command. .php and .html files are not in same folder (.html is in subfolder) , but i tried putting them together and it changed nothing.

This is the code from my Contact. html file for the form:

`

        <p>
        <label for="name">Nome:</label>
        <input type="text" name="name" placeholder="*Ex: Mario Rossi" required>
        </p>  

        <p>  
        <label for="name">Email:</label>
        <input type="text" name="email" placeholder="*Ex: Mario123@domain.com" required>
        </p>  

        <p>  
        <label for="name">Ogetto:</label>
        <input type="text" name="subject" required>
        </p>  

        <p>  

    <label for="message">Messagio:</label> <br>
    <textarea name="body" id="message" cols="30" rows="10">
            
            </textarea>
    <input id="submit" name="Submit" value="INVIA" type="submit">
            </p>  
    
    </form>    `

And this is the code for app.php:

    <?php ob_start();
  
if(isset($_POST['submit'])) {

$to = "myemail@yahoo.com";
$subject = $_POST['subject'];
$email = $_POST['email'];
$txt = $_POST['message'];

mail($to,$subject,$txt);

header("Location: Contact.html");
}

?>   
Gest
  • 1

0 Answers0