This will work :)
<?php
if(isset($_POST['contact']))
//Uses the isset function to determine if the forms been posted or not.
{
$name = $_POST['name'];
$email = $_POST['email'];
$subj = $_POST['subj'];
$msg = $_POST['msg'];
$ip = $_SERVER['REMOTE_ADDR'];
//Creates variables for the post data and the users ip address.
if(!$name || !$email || !$msg)
//Checks for blank fields.
{
die("Error! Some fields were left blank! Please go back.");
//Alert the user. and kill the script.
}
else
//There's no blank fields so we continue..
{
$mail = "
[email protected]";
//Change to your email address..
$subject = "$name - $subj";
//The subject of the email..
$messg = "
Name: $name
Email Address: $email
IP Address: $ip\n
Message:
$msg";
//The email message..
mail("$mail", $subject, $messg);
//Uses the mail function to send the email.
echo("Thank you for applying for <b>$subj</b> we will get back to you within 1 weeks time. Please be patient as we are very busy during this process.
<br><br>
<i>Thanks,<br>
HabbosVoice management</i>");
//The thank you message.
}
}
else
//The form hasn't been submitted..
{
echo("<font face=\"Verdana\" size=\"2\"><p align=\"center\">
<p><form method=\"post\">
<table width=\"600\" cellspacing=\"2\" cellpadding=\"0\">
<tr><td width=\"150\"><font face=\"Verdana\" size=\"1\">Habbo Name:</font></td>
<td width=\"450\"><input type=\"text\" name=\"name\" size=\"30\" /></td></tr>
<tr><td width=\"150\"><font face=\"Verdana\" size=\"1\">Email Address:</font></td>
<td width=\"450\"><input type=\"text\" name=\"email\" size=\"30\" /></td></tr>
<tr><td width=\"150\"><font face=\"Verdana\" size=\"1\">Job:</font></td>
<td width=\"450\"><select name=\"subj\">
<option>DJ</option>
<option>Radio Manager</option></select></td></tr>
<tr><td width=\"150\"><font face=\"Verdana\" size=\"1\">Why do you want to work for us:</font></td>
<td width=\"450\"><textarea name=\"msg\" cols=\"44\" rows=\"7\"></textarea></td></tr>
<tr><td colspan=\"2\" align=\"center\"><input type=\"submit\" name=\"contact\" value=\"Apply\" /></td></tr>
</table></form></p></font>");
//The form..
}
?>
The reason why your Html wasent working is because: A normal Html code looks like this:
<font face="Verdana" size="1">
Now that works in .htm and SOMETIMES php
but if you want to be safe use:
<font face=\"Verdana\" size=\"1\">
You need to add \ slash's before the last " and at the = sign