I'm just new in php actually and this is the problem that i have been encountering lately. I actually have one .html file and .php file, on the .html file I created a form which looks like this:
<table cellpadding="0" cellspacing="5" border="0" width="500" align="center">
<form name="FAQ" method="post" action="question.php">
<span style="font-family: Arial, Helvetica, sans-serif;font-size: 12px;font-style: normal;line-height: normal;font-weight: normal;font-variant: normal;text-transform: none;color: #000000;">
<tr>
<td width="150"><p class="content">Name: * </td>
<td width="350"><input type="text" size="55" name="name"></td>
</tr>
<tr>
<td width="150"><p class="content">Email Address: * </td>
<td width="350"><input type="text" size="55" name="email"></td>
</tr>
<tr>
<td width="150"><p class="content">Question: * </td>
</tr>
<tr>
<td width="350" colspan="2"><textarea cols="59" rows="5"></textarea name="question"></td>
</tr>
<tr>
<td colspan="2" align="right"><input type="submit" value="Submit" name="submit"></td>
</tr>
<tr>
<td> </td>
</tr>
</form>
</table>
And here is the .php file:
<?php
if (isset($_POST["submit"]))
{
$name = $_POST['name'];
$email = $_POST['email'];
$question = $_POST['question'];
$message = "Message from $name \n Message: $question";
mail($email,Inquiry,$message);
echo "Message sent.";
}
else
{
echo "Sending failed, please input the required fields.";
}
?>
The problem that i'm encountering here is, in each textbox in the.html file i just live it blank, once that i click on the "Submit" button, the output that would be displayed is "Message sent.", instead of "Sending failed, please input the required fields."
Please help me here.. Thanks, been trying to solve it for almost 6hours already, and still i get the same output.
thanks in advance.