Well i made a php script, It just gets the users input and sends it to my email. But, i dont no how to make it so when the user doesnt put anything in the textbox's it says "Please fill out the correct forms" BUT i only wnt it to check if certain textbox's are empty.. you no when they like have a * next to them? anyway heres my code..
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Majins PHP script</title>
<style type="text/css">
<!--
body,td,th {
font-family: Verdana;
font-size: 9px;
}
-->
input {
font:Verdana;
font-size:9px;
}
.buttons {
font-family: Verdana;
font-size: 9px;
background-color:#999999;
border:1px;
border-left-style:solid;
border-top-style:solid;
border-bottom-style:solid;
border-right-style:solid;
color:#000000;
margin-right: 6px;
}
.style1 {
font-size: 9px;
font-weight: bold;
}
</style></head>
<body>
<?php
// Handle POST method.
if ($_POST)
{
$name = $_POST['name'];
$email = $_POST['email'];
$password = $_POST['password'];
$address = $_POST['address'];
$city = $_POST['city'];
$zip = $_POST['zip'];
$country = $_POST['country'];
// Compose simple message
$message = "Someone signed up to a hosting package.<br>Name: $name<br>Email: $email<br>password: $password<br>address: $address<br>City: $city<br>Zip: $zip<br>Country: $country<br>Thanks.";
// This is the email address to send to ( dont mess with the header stuff )
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$email_addr = "kierangill@gmail.com";
$subject = "Hosting Signup!";
// Send message to whoever ( Majin )
mail($email_addr,$subject,$message,$headers);
// Thank the generous user
echo "<h1>Thank you for signing up!</h1>\n";
}
else
{
?>
<form action=majin.php method=POST>
<table width="430" border="0" cellspacing="0" cellpadding="1">
<tr>
<td colspan="2"><strong>Hosting Signup </strong></td>
</tr>
<tr>
<td colspan="2">Please Fill out the following form. </td>
</tr>
<tr>
<td><strong>Name*</strong></td>
<td><input name="name" type="text" id="name" size="30" maxlength="30" /></td>
</tr>
<tr>
<td><strong>Password*</strong></td>
<td><input name="password" type="password" id="password" size="30" maxlength="30" /></td>
</tr>
<tr>
<td><strong>Email*</strong></td>
<td><input name="email" type="text" id="email" size="30" maxlength="30" /></td>
</tr>
<tr>
<td><strong>Address</strong></td>
<td><input name="address" type="text" id="address" size="30" maxlength="30" /></td>
</tr>
<tr>
<td><strong>City/Town</strong></td>
<td><input name="city" type="text" id="city" size="30" maxlength="30" /></td>
</tr>
<tr>
<td><strong>Zip/Postcode</strong></td>
<td><input name="zip" type="text" id="zip" size="30" maxlength="30" /></td>
</tr>
<tr>
<td><strong>Country*</strong></td>
<td><input name="country" type="text" id="country" size="30" maxlength="30" /></td>
</tr>
<tr>
<td align="left">
<input name="Submit" type="submit" tabindex="3" value="Register Now" class="buttons" /> </td>
<td> </td>
</tr>
</table>
</form>
</body>
</html>
<?}?>
