CODE
<form action="" method="post" name="onlinepriscription" id="onlinepriscription">
<table width="455" border="0">
<tr>
<td width="69">First Name </td>
<td width="145"><input type="text" name="fname" class="input" id="fname" size="20" value="<? echo $_POST['fname'];?>"/></td>
<td width="79">Last Name </td>
<td width="144">
<input type="text" name="lname" class="input" id="lname" size="25" value="<? echo $_POST['lname'];?>" />
</td>
</tr>
<tr>
<td>Sex</td>
<td><input type="text" name="sex" class="input" id="sex" size="20" value="<? echo $_POST['sex'];?>" /></td>
<td>Age</td>
<td>
<input type="text" name="age" class="input" id="age" size="20" value="<? echo $_POST['age'];?>" />
</td>
</tr>
<tr>
<td>Date </td>
<td><input type="text" name="date" class="input" id="date" size="20" value="<? echo $_POST['date'];?>" /></td>
<td>Date of Birth </td>
<td>
<input type="text" name="DOB" class="input" id="DOB" value="<? echo $_POST['DOB'];?>" />
</td>
</tr>
<tr>
<td>Address</td>
<td>
<input type="text" name="address" class="input" id="address" value="<? echo $_POST['address'];?>" />
</td>
<td>Doctor name </td>
<td>
<input type="text" name="docname" class="input" id="docname" value="<? echo $_POST['docname'];?>"/>
</td>
</tr>
</table>
<br />
<table width="466" border="0">
<tr>
<th width="147" scope="col">Drug Name </th>
<th width="66" scope="col">Strgn</th>
<th width="65" scope="col">Qty</th>
<th width="63" scope="col">Dur.</th>
<th width="103" scope="col">Fourmulation </th>
</tr>
<tr>
<td>
<input type="text" name="dname1" class="input" id="dname1" value="<? echo $_POST['dname1'];?>"/>
</td>
<td>
<input type="text" name="str1" class="input" id="str1" size="10" value="<? echo $_POST['str1'];?>"/>
</td>
<td>
<input type="text" name="qty1" class="input" id="qty1" size="10" value="<? echo $_POST['qty1'];?>" />
</td>
<td>
<input type="text" name="dur1" class="input" id="dur1"size="10" value="<? echo $_POST['dur1'];?>"/>
</td>
<td>
<input type="text" name="fmu1"size="15" class="input" id="fmu1" value="<? echo $_POST['fmu1'];?>" />
</td>
</tr>
<tr>
<td>
<input type="text" name="dname2" class="input" id="dname2" value="<? echo $_POST['dname2'];?>"/>
</td>
<td>
<input type="text" name="str2" class="input" id="str2" size="10" value="<? echo $_POST['str2'];?>"/>
</td>
<td>
<input type="text" name="qty2" class="input" id="qty2" size="10" value="<? echo $_POST['qty2'];?>" />
</td>
<td>
<input type="text" name="dur2" class="input" id="dur2"size="10" value="<? echo $_POST['dur2'];?>"/>
</td>
<td>
<input type="text" name="fmu2"size="15" class="input" id="fmu2" value="<? echo $_POST['fmu2'];?>" />
</td>
</tr>
<tr>
<td>
<input type="text" name="dname3" class="input" id="dname3" value="<? echo $_POST['dname3'];?>"/>
</td>
<td>
<input type="text" name="str3" class="input" id="str3" size="10" value="<? echo $_POST['str3'];?>"/>
</td>
<td>
<input type="text" name="qty3" class="input" id="qty3" size="10" value="<? echo $_POST['qty3'];?>" />
</td>
<td>
<input type="text" name="dur3" class="input" id="dur3"size="10" value="<? echo $_POST['dur3'];?>"/>
</td>
<td>
<input type="text" name="fmu3"size="15" class="input" id="fmu3" value="<? echo $_POST['fmu3'];?>" />
</td>
</tr>
<tr>
<td>
<input type="text" name="dname4" class="input" id="dname4" value="<? echo $_POST['dname4'];?>"/>
<td>
<input type="text" name="str4" class="input" id="str4" size="10" value="<? echo $_POST['str4'];?>"/>
</td>
<td>
<input type="text" name="qty4" class="input" id="qty4" size="10" value="<? echo $_POST['qty4'];?>" />
</td>
<td>
<input type="text" name="dur4" class="input" id="dur4"size="10" value="<? echo $_POST['dur4'];?>"/>
</td>
<td>
<input type="text" name="fmu4"size="15" class="input" id="fmu4" value="<? echo $_POST['fmu4'];?>" />
</td>
</tr>
<tr>
<td>
<input type="text" name="dname5" class="input" id="dname5" value="<? echo $_POST['dname5'];?>"/>
</td>
<td>
<input type="text" name="str5" class="input" id="str5" size="10" value="<? echo $_POST['str5'];?>"/>
</td>
<td>
<input type="text" name="qty5" class="input" id="qty5" size="10" value="<? echo $_POST['qty5'];?>" />
</td>
<td>
<input type="text" name="dur5" class="input" id="dur5"size="10" value="<? echo $_POST['dur5'];?>"/>
</td>
<td>
<input type="text" name="fmu5"size="15" class="input" id="fmu5" value="<? echo $_POST['fmu5'];?>" />
</td>
</tr>
<tr>
<td>
<input name="Submit" type="submit" onClick="MM_validateForm('fname','R','lname','sex','age','DOB','address','docname',date','dname1','str1','qty1','dur1','fmu1','dname2','str2','qty2','dur2','fmu2','dname3','str3','qty3','dur3','fum3','dname4','str4','qty4','dur4','fmu4','dname5','str5','dur5','fmu5');return document.MM_returnValue" value="Submit Priscription" />
<input type="reset" value="Reset"/>
<tr>
<td colspan="4" valign="top" nowrap="nowrap"><input name="run" type="hidden" id="run" value="GO" />
<? if($_POST['run']!=""){
$fname=$_POST['fname'];
$lname=$_POST['lname'];
$age=$_POST['age'];
$address=$_POST['address'];
$dname1=$_POST['dname1'];
$str1=$_POST['str1'];
$qty1=$_POST['qty1'];
$dru1=$_POST['dru1'];
$frm1=$_POST['fmu1'];
$to='farbesyboo@hotmail.com';
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
// Additional headers
$headers .= 'To: farbesyboo@hotmail.com' . "\r\n";
$headers .= 'From:<.$docname.>' . "\r\n";
//$body=" hi ";
$body='
Attched priscription for
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Valuation Request form</title>
<link href="" rel="stylesheet" type="text/css">
</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><h2 align="center"><u> <br />
[u]</u></h2></td>
</tr>
<tr>
<td><div align="center"><br />
<br />
<strong><u>Online Priscription </u></strong><br />
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<strong><u>Patient Information </u></strong><br />
<tr>
<td valign="top" nowrap="nowrap"><strong>First name </strong> <label class="content">'.$fname.'</label></td></tr>
<tr>
<td valign="top" nowrap="nowrap"><strong>Last Name </strong> <label class="content">'.$lname.'</label></tr>
<tr>
<td valign="top" nowrap="nowrap"><strong>Sex </strong> <label class="content">'.$sex.'</label></tr>
<tr>
<td valign="top" nowrap="nowrap"><strong>Age </strong> <label class="content">'.$age.'</label></tr>
<tr>
<td valign="top" nowrap="nowrap"><strong>Date of birth </strong> <label class="content">'.$DOB.'</label></tr>
<tr>
<td valign="top" nowrap="nowrap"><strong>Address </strong> <label class="content">'.$address.'</label></tr>
<tr>
<td valign="top" nowrap="nowrap"><strong>Doctors name </strong> <label class="content">'.$docname.'</label></tr>
<strong><u>Drugs:-</u></strong><br />
<tr>
<td valign="top" nowrap="nowrap"><strong>1.Drug Name </strong> <label class="content">'.$dname1.'</label>
<td valign="top" nowrap="nowrap"><strong>Strength </strong> <label class="content">'.$str1.'</label>
<td valign="top" nowrap="nowrap"><strong>Quanity </strong> <label class="content">'.$qty1.'</label>
<td valign="top" nowrap="nowrap"><strong>Duration </strong> <label class="content">'.$dur1.'</label>
<td valign="top" nowrap="nowrap"><strong>Formulation </strong> <label class="content">'.$fmu1.'</label>
</tr>
<tr>
<td valign="top" nowrap="nowrap"><strong>2.Drug Name </strong> <label class="content">'.$dname2.'</label>
<td valign="top" nowrap="nowrap"><strong>Strength </strong> <label class="content">'.$str2.'</label>
<td valign="top" nowrap="nowrap"><strong>Quanity </strong> <label class="content">'.$qty2.'</label>
<td valign="top" nowrap="nowrap"><strong>Duration </strong> <label class="content">'.$dur2.'</label>
<td valign="top" nowrap="nowrap"><strong>Formulation </strong> <label class="content">'.$fmu2.'</label>
</tr>
<tr>
<td valign="top" nowrap="nowrap"><strong>3.Drug Name </strong> <label class="content">'.$dname3.'</label>
<td valign="top" nowrap="nowrap"><strong>Strength </strong> <label class="content">'.$str3.'</label>
<td valign="top" nowrap="nowrap"><strong>Quanity </strong> <label class="content">'.$qty3.'</label>
<td valign="top" nowrap="nowrap"><strong>Duration </strong> <label class="content">'.$dur3.'</label>
<td valign="top" nowrap="nowrap"><strong>Formulation </strong> <label class="content">'.$fmu3.'</label>
</tr>
<tr>
<td valign="top" nowrap="nowrap"><strong>4.Drug Name </strong> <label class="content">'.$dname4.'</label>
<td valign="top" nowrap="nowrap"><strong>Strength </strong> <label class="content">'.$str4.'</label>
<td valign="top" nowrap="nowrap"><strong>Quanity </strong> <label class="content">'.$qty4.'</label>
<td valign="top" nowrap="nowrap"><strong>Duration </strong> <label class="content">'.$dur4.'</label>
<td valign="top" nowrap="nowrap"><strong>Formulation </strong> <label class="content">'.$fmu4.'</label>
</tr>
<tr>
<td valign="top" nowrap="nowrap"><strong>5.Drug Name </strong> <label class="content">'.$dname5.'</label>
<td valign="top" nowrap="nowrap"><strong>Strength </strong> <label class="content">'.$str5.'</label>
<td valign="top" nowrap="nowrap"><strong>Quanity </strong> <label class="content">'.$qty5.'</label>
<td valign="top" nowrap="nowrap"><strong>Duration </strong> <label class="content">'.$dur5.'</label>
<td valign="top" nowrap="nowrap"><strong>Formulation </strong> <label class="content">'.$fmu5.'</label>
</tr>
</table>
</table></td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>
';
$subject='priscription for patient';
if (mail($to, $subject, $body, $headers ))
{
echo "<script> alert('$cellmsg Message Sent!');</script>";
}
else
{
echo "<script> alert('$cellmsg Message fail to Deleiver!');</script>";
}
}
?>
</td>
</tr>
</table>
<br />
<br />
<br />
<br />
</form>
[mod edit] Use the code tags. It's not that hard.