My submit button with an image/style does not work. But the test button but I created in addition kinda does something at least.
Background story: I want to use a contact formular on my website. It has a specific style, that I would like to keep. Especially the submit button.
Behaviour of the actual submit button: When I click it, nothing happens.
Test button behaviour: When I click it, it should run my php file and send 2 mails out. To the creator and the webmaster. But it actually just shows me the content of my php file in a new tab. I am not sure if that is because I am running it locally. I have no access to my webserver right now, so I woul appreciate if you can answer me that.
Here is a part of my html code: (If you need more code, just lemme know.) I apologize for all the german words in there.
<form enctype="multipart/form-data" action="kontakt.php" method="POST">
<div style="text-align:left; margin-top:10px; margin-bottom:10px;">
<input type="hidden" name="form_version" value="2" />
<input type="hidden" name="wsite_approved" id="wsite-approved" value="approved" />
<input type="hidden" name="ucfid" value="469466791613027794" />
<input type="submit" value="testabsenden"</input>
<input type="submit" style='position:absolute;top:0;left:-9999px;width:1px;height:1px' /><a class='wsite-button'><span class='wsite-button-inner'>Absenden</span></a>
</div>
</form>
And of course the php part: (i'll just give you the full code, since its not super long)
<?php
$anrede = $_REQUEST['anrede'];
$name = $_REQUEST['name'];
$nachname = $_REQUEST['nachname'];
$mail = $_REQUEST['mail'];
$nachricht = $_REQUEST['nachricht'];
$empfaenger = "info@input-recordings.de ";
$absender = $mail;
$betreffwebmaster="Kontaktanfrage ($name $nachname)";
$inhaltwebmaster = "$name $nachname hat über die Webseite folgende Kontaktanfrage gestellt: \n\n".
"\n\n
Kontaktdaten: \n
\tName: $anrede $name $nachname \n
\teMail: $mail \n
\n\n".
$nachricht;
$betreffkunde="Kontaktanfrage ($name $nachname)";
$inhaltkunde = "$name $nachname hat über die Webseite folgende Kontaktanfrage gestellt: \n\n".
"\n\n
Kontaktdaten: \n
\tName: $anrede $name $nachname \n
\teMail: $mail \n
\n\n".
$nachricht;
$abgesandt = "<h1> Kontaktbestätigung</h1><p>Vielen Dank für Ihre Anfrage. Wir werden uns in Kü:rze bei Ihnen melden.<br><br>Thank you for your inquiry. We will get back in touch with you shortly!<br><br><br></p>";
mail("$empfaenger","$betreffwebmaster","$inhaltwebmaster","FROM: $absender");
mail("$mail","$betreffkunde","$inhaltkunde","FROM: $absender");
echo $abgesandt;
?>