0

I want to stay on the same page after clicking on submit button And also add the information: "Email was sent" on the same page after clicking. I am totally naked in php, so I could only write something like this:

<?php   
        $name = $_POST['name']; 

        $email = $_POST['email'];

        $phone = $_POST['phone'];

        $surname = $_POST['surname'];

        $call = $_POST['call'];

        $rodzaj = $_POST['rodzaj'];

        $dach = $_POST['dach'];

        $strop = $_POST['strop'];

        $garaz = $_POST['garaz'];

        $formcontent=" Od: $name \n Nazwisko: $surname \n Telefon: $phone \n Rodzaj domu: $rodzaj \n Rodzaj zadaszenia: $dach \n Rodzaj stropu: $strop \n Garaz: $garaz \n Accept: $call ";

        $recipient = "tomek@blosom.it";

        $subject = "Contact Form SimplyBau";

        $mailheader = "From: $email \r\n";
        mail($recipient, $subject, $formcontent, $mailheader) or die("Error!");

        //echo "Thank You!" . " -" . "<a href='form.html' style='text-decoration:none;color:#ff0099;'> Return Home</a>";

?>

Is it possible to add something to my php file in order to NOT load new page but stay on the same where is contact form?

Ahmed Ginani
  • 6,522
  • 2
  • 15
  • 33
Blosom
  • 111
  • 2
  • 12

0 Answers0