I have made a simple HTML form in Liferay. When the form is submitted, its content should go to my email address and a line saying 'thank you' is to be displayed. I have done the action part with php. But after submitting, all I get is the 'thank you' part and the form doesn't get submitted to my email address.
Any idea why this doesn't work? I am not good with PHP at all. Only the basics.
Is there any other way to do this? e.g with javascript? though that might not be a good option.
I am using Liferay 6.1 and Tomcat 7.
HTML form:
<form name="form" method="post" action="form.php">
<table>
</tr>
<tr>
<td>
<label for="first_name">First Name</label>
</td>
<td>
<input type="text" name="first_name" maxlength="50" size="30">
</td>
</tr>
<tr>
<td>
<label for="last_name">Last Name</label>
</td>
<td>
<input type="text" name="last_name" maxlength="50" size="30">
</td>
</tr>
</table>
</form>
PHP:
<?php
if(isset($_POST['email'])) {
// Email where form is sent:
$email_to = "myemail@mydomain.com";
Thank you!
<?php
}
die();
?>