Ho un modulo di contatto che ho usato molte volte in precedenza su altri siti non WP ma non sembra funzionare sul mio attuale sito WP , ti reindirizza a una pagina non trovata.
Non voglio usare alcun plugin per crearlo.
Ecco il codice:
<form class="form" method="POST" action="<?php the_permalink(); ?>">
<table border="0" style="float:left;">
<tbody>
<tr>
<td>
<p>Company Name:</p>
</td>
<td> </td>
<td><input type="text" name="companyname" id="companyname" /></td>
</tr>
<tr>
<td>
<p>Your Name:</p>
</td>
<td> </td>
<td><input type="text" name="name" id="name" /></td>
</tr>
<tr>
<td>
<p>E-mail:</p>
</td>
<td> </td>
<td><input type="text" name="email" id="email" /></td>
<td colspan="2"> </td>
</tr>
<tr>
<td>
<p>Telephone:</p>
</td>
<td> </td>
<td><input type="text" name="tel" id="tel" /></td>
<td colspan="2"> </td>
</tr>
</tbody>
</table>
<table border="0" style="float:left;" width="450">
<tbody>
<tr>
<td valign="top"><p style="margin-left:42px;margin-right:10px;margin-top:7px;">Enquiry:</p></td>
<td><textarea name="enquiry"></textarea></td>
</tr>
<tr>
<td colspan="2"><button class="blue medium awesome awesomeforward" type="submit" name="submit">Send message</button></td>
</tr>
</tbody>
</table>
<? if(isset($_POST['submit'])) {
$to = "rob@teamworksdesign.com";
$subject = "Teamworks contact enquiry";
$companyname_field = $_POST['companyname'];
$name_field = $_POST['name'];
$email_field = $_POST['email'];
$tel_field = $_POST['tel'];
$enquiry_field = $_POST['enquiry'];
$body = "Hello Teamworks,\n\n You have an enquiry from the website, please see the details below:\n\n Name: $name_field\n Company Name: $companyname_field\n E-Mail: $email_field\n Tel: $tel_field\n Message:\n $enquiry_field\n\n Please reply to the enquiry asap.\n\n Kind Regards \n The Teamworks Website";
mail($to, $subject, $body);
echo "</br>Thank you for getting in touch, we will contact you shortly.";
} ?>
</form>
name="name"
in qualcos'altro.