Having issue in my application form download.My issue is.once the form is submitted my java script code is not submitting the form to another page.page name is app_print.php.I have implemented js code in php.once every thing is correct.the app_print.php goes to download section.I have hosted in my webserver. Here is the link. http://lisieuxcbsekovai.com/application.php
Here is my code:
application.php
<form action="" method="post" name="application">
<table width="100%" border="0" cellspacing="0" cellpadding="5">
<tr>
<td colspan="3">
<?php
if(isset($_POST['application']))
{
unset($_POST['application']);
if(isset($rep))
{
if($rep=='sus')
{
?>
<div class="sus cl"><img class="pa" src="controller/image/btn/tick_circle.png"/><?php echo $msg;?><a style="margin:0px 0px 0px 0px;" href="javascript:void(0);"><img id="close" src="controller/image/btn/cross_grey_small.png"/></a></div>
<?php
}
else if($rep=='fld')
{
?>
<div class="error cl"><img class="pa" src="controller/image/btn/cross_circle.png"/><?php echo $msg;?><img id="close" src="controller/image/btn/cross_grey_small.png"/></div>
<?php
}
else if($rep=='atn')
{
?>
<div class="atn cl"><img class="pa" src="controller/image/btn/exclamation.png"/><?php echo $msg;?><img id="close" src="controller/image/btn/cross_grey_small.png"/></div>
<?php
}
}
}
?>
</td>
</tr>
<tr>
<th class="lft_col" colspan="3" style="color:#DB0009">APPLICATION FORM</th>
</tr>
<tr>
<td class="red">1.</td>
<th class="lft_col"><label>Name of the child<span class="red">*</span><br/><span style="font-size:11px;">(In Block letter)</span></label></th>
<td><input class="text" type="text" name="name" placeholder="Enter your Name" required value=""/></td>
</tr>
<tr>
<td class="red">2.</td>
<th class="lft_col"><label>Sex</label><span class="red">*</span></th>
<td>
<select class="select_2" name="sex" required>
<option value="">---Select---</option>
<option value="Male">Male</option>
<option value="Female">Female</option>
<option value="Other">Other</option>
</select>
</td>
</tr>
<tr>
<td class="red">3.</td>
<th class="lft_col"><label>Name of Parents<span class="red">*</span></label></th>
<td>
<table style="text-align:left;" width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="red">i.</td>
<th class="lft_col">Father Name</th>
<td><input class="text" type="text" name="father" placeholder="Your Father/Guardian Name" required value=""/></td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td class="red">ii.</td>
<th class="lft_col">Mother Name</th>
<td><input class="text" type="text" name="mother" placeholder="Your Mother Name" required value=""/></td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="red">4.</td>
<th class="lft_col"><label>Address for <br/>communication<span class="red">*</span><label></th>
<td><textarea class="text" rows="10" placeholder="Your Communication Address." required name="address"></textarea></td>
</tr>
<tr>
<td class="red">5.</td>
<th class="lft_col">Contact No<span class="red">*</span></th>
<td><input class="text" type="text" name="mobile" placeholder="Mobile:+91 999999999" required value=""/></td>
</tr>
<tr>
<td class="red">6.</td>
<th class="lft_col"><label>Occupation of <br/>Parents with details<span class="red">*</span></label></th>
<td>
<table style="text-align:left;" width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="red">i.</td>
<th class="lft_col"><label>Father Occupation</label></th>
<td><input class="text" type="text" name="father_occ" placeholder="Your Father/Guardian Occupation details" required value=""/></td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td class="red">ii.</td>
<th class="lft_col"><label>Mother Occupation</label></th>
<td><input class="text" type="text" name="mother_occ" placeholder="Your Mother Occupation details" required value=""/></td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="red">7.</td>
<th class="lft_col"><label>Date of Birth<span class="red">*</span><br/><span style="font-size:11px;">(as per Birth certificate)</span></label></th>
<td><input class="text" type="date" name="dob" placeholder="Your Date of Birth" required value=""/></td>
</tr>
<tr>
<td class="red">8.</td>
<th class="lft_col"><label>No of Year & Months that will <br/>be Completed as on June 1st<span class="red">*</span></label></th>
<td><input class="text" type="text" name="age" placeholder="Your Age (YYYY/MM/DD)" required value=""/></td>
</tr>
<tr>
<td class="red">9.</td>
<th class="lft_col"><label>Religion & Caste<span class="red">*</span><br/><span style="font-size:11px;">for Statistical purpose only</span></label></th>
<td><input class="text" type="text" name="religion" placeholder="Your Religion & Caste" required value=""/></td>
</tr>
<tr>
<td colspan="2"> </td>
<td class="lft_col">
<input class="btn" type="submit" name="application" value="Submit"/>
<input class="btn" onClick="javascript:window.location='application.php'" type="button" name="Cancel" value="Cancel"/>
</td>
</tr>
</table>
</form>
application.php
if(isset($_POST['application']))
{
$name=$_POST['name'];
$sex=$_POST['sex'];
$father=$_POST['father'];
$mother=$_POST['mother'];
$address=$_POST['address'];
$mobile=$_POST['mobile'];
$father_occ=$_POST['father_occ'];
$mother_occ=$_POST['mother_occ'];
$dob=$_POST['dob'];
$age=$_POST['age'];
$religion=$_POST['religion'];
date_default_timezone_set('Asia/Kolkata');
$cur_date = date('m/d/Y h:i:s a', time());
if($name!=''&&$sex!=''&&$father!=''&&$mother!=''&&$address!=''&&$mobile!=''&&$father_occ!=''&&$mother_occ!=''&&$dob!=''&&$age!=''&&$religion!='')
{
$con_qry=mysql_query("insert into application (name,sex,father,mother,address,mobile,father_occ,mother_occ,dob,age,religion,cur_date) values('".$name."','".$sex."','".$father."','".$mother."','".$address."','".$mobile."','".$father_occ."','".$mother_occ."','".$dob."','".$age."','".$religion."','".$cur_date."')");
if($con_qry)
{
$rep="sus";
$msg='Your application is downloaded, you can print the application from your download path.';
echo "<script type='text/javascript'>var url='app_print.php?id=$cur_date&c_name=$name';window.open(url)</script>";
}
else
{
$rep="fld";
$msg='Registeration Faild.';
}
}
}
?>
my app_print.php:
if((isset($_GET['id']))&&(isset($_GET['c_name'])))
{
$print=mysql_query("select * from application where name='".$_GET['c_name']."' and cur_date='".$_GET['id']."'");
$p_r=mysql_num_rows($print);
if($p_r>0)
{
$print_val=mysql_fetch_array($print);
$aid=$print_val['aid'];
$name=$print_val['name'];
$sex=$print_val['sex'];
$father=$print_val['father'];
$mother=$print_val['mother'];
$address=$print_val['address'];
$mobile=$print_val['mobile'];
$father_occ=$print_val['father_occ'];
$mother_occ=$print_val['mother_occ'];
$dob=$print_val['dob'];
$age=$print_val['age'];
$religion=$print_val['religion'];
$cur_date =$print_val['cur_date'];
header("Content-Type: application/download");
header("Content-Type: application/msword");
header('content-Disposition: attachment; filename='.$name.' Application'.'.doc');
}
}
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>LISIEUX - APPLICATION FORM</title>
</head>
<body>
<form action="" method="post" name="app_print">
<table width="100%" border="0" cellspacing="0" cellpadding="5">
<tr>
<td colspan="3" style="text-align:center;"><label><b style="font-size:29px;">Lisieux CMI Public School</b></label><br/><label>(CBSE Syllabus)</label><br/><label>Lisieux Road,Saravanampatti,Viswasapuram,Coimbatore - 641035.</label></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td style="border-top:1px solid #000000;"> </td>
<td style="border-top:1px solid #000000;"> </td>
<td style="border-top:1px solid #000000;"> </td>
</tr>
<tr>
<th colspan="3" style="text-align:center;">REGISTRATION FORM</th>
</tr>
<tr>
<td> </td>
<td> </td>
<td style="text-align:right;"><label>Reg.No. : <?php if(isset($aid)){echo $aid;}?></label></td>
</tr>
<tr>
<td>1.</td>
<th><label>Name of the child<br/><span style="font-size:16px;">(In Block letter)</span></label></th>
<td><label><?php if(isset($name)){echo $name;}?></label></td>
</tr>
<tr>
<td>2.</td>
<th><label>Sex</label></th>
<td><label><?php if(isset($sex)){echo $sex;}?></label></td>
</tr>
<tr>
<td>3.</td>
<th><label>Name of Parents</label></th>
<td>
<table style="text-align:left;" width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>i.</td>
<th><label>Father : </label></th>
<td><label><?php if(isset($father)){echo $father;}?></label></td>
</tr>
<tr>
<td>ii.</td>
<th><label>Mother : </label></th>
<td><label><?php if(isset($mother)){echo $mother;}?></label></td>
</tr>
</table>
</td>
</tr>
<tr>
<td>4.</td>
<th><label>Address for <br/>communication</label></th>
<td><label><?php if(isset($address)){echo $address;}?></label></td>
</tr>
<tr>
<td>5.</td>
<th>Contact No</th>
<td><label><?php if(isset($mobile)){echo $mobile;}?></label></td>
</tr>
<tr>
<td>6.</td>
<th><label>Occupation of <br/>Parents with details</label></th>
<td>
<table style="text-align:left;" width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>i.</td>
<th><label>Father : </label></th>
<td><label><?php if(isset($father_occ)){echo $father_occ;}?></label></td>
</tr>
<tr>
<td>ii.</td>
<th><label>Mother : </label></th>
<td><label><?php if(isset($mother_occ)){echo $mother_occ;}?></label></td>
</tr>
</table>
</td>
</tr>
<tr>
<td>7.</td>
<th><label>Date of Birth<br/><span style="font-size:16px;">(as per Birth certificate)</span></label></th>
<td><label><?php if(isset($dob)){echo $dob;}?></label></td>
</tr>
<tr>
<td>8.</td>
<th><label>No of Year & Months that will be<br/>Completed as on June 1st</label></th>
<td><label><?php if(isset($age)){echo $age;}?></label></td>
</tr>
<tr>
<td>9.</td>
<th><label>Religion & Caste<br/><span style="font-size:16px;">for Statistical purpose only</span></label></th>
<td><label><?php if(isset($religion)){echo $religion;}?></label></td>
</tr>
<tr>
<td colspan="3">
<table width="100%" border="0" cellspacing="0" cellpadding="5">
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td><label>Date : <?php if(isset($cur_date)){echo $cur_date;}?></label></td>
<td style="text-align:right;">Signature of Parent/Guardian</td>
</tr>
</table>
</td>
</tr>
</table>
</form>
window.open does (surprise) open a new browser window. Are you sure there is no pop-up blocker active in your browser? Otherwise you might miss the popup. You can debug Javascript with the F12 debugging tools in all major browsers. Set a breakpoint to the window.open line and see if the line is called. Some pop-up blockers also log to the console also available via F12
window.open() unfortunately has a way of getting 'blocked' by most browsers as an 'unwanted' pop-up if used during a page load - it is probably advisable to use a different way of calling the window.open() statement. An alternative way to accomplish what you are attempting (and side stepping popup blockers) is to consider changing your statement in app_print.php:
echo "<script type='text/javascript'>var url='app_print.php?id=$cur_date&c_name=$name';window.open(url)</script>";
to something like:
echo "<script type='text/javascript'>window.onload=function () { window.location='/app_print.php?id=$cur_date&c_name=$name' }; </script>";
and thus not using window.open() at all.
My code will submit data to my database if I use action="", but I want the action attribute to open a confirmation page to let users know their data has been registered. This confirmation page should appear onclick of the submit button and only after user's data has been stored in my database. My code will not submit data to my database if I use action="regconfirm.html" (which is my confirmation page), but the confirmation page opens like it should. I have tried to use onsubmit="location.href='...registerform/regconfirm.html'" and onclick="location.href='...registerform/regconfirm.html'" in the submit tag. This also doesn't submit data to my database. The form has many text fields and radio buttons which all work perfectly and validation is done using the required attribute in each field object's tag. I believe the problem is in the form tag I am providing all code in the body here.
<body>
**<form action="<?php echo $editFormAction; ?>" method="POST" enctype="multipart/form-data" name="form" id="form">**
<table width="729" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td colspan="3"> </td>
<td width="497" colspan="2"> </td>
</tr>
<tr>
<td colspan="3" align="left" valign="top">(สามารถถ่ายเอกสารได้)</td>
<td colspan="2" rowspan="3" align="right"><table width="344" border="4" align="right" cellpadding="2" cellspacing="0" class="tableborder">
<tr>
<td width="306" colspan="2" align="right"><table width="326" border="0" cellspacing="0" cellpadding="4">
<tr>
<td align="right">ใบเสร็จรับเงินเลขท
<input name="text_1" type="text" class="formfield" id="text_1" value="<?php echo $row_Recordset1['text_1']; ?>" size="25" maxlength="255" autofocus required/></td>
</tr>
<tr>
<td align="right">ลงวันท
<input name="text_2" type="text" class="formfield" id="text_2" value="<?php echo $row_Recordset1['text_2']; ?>" size="25" maxlength="255" required/></td>
</tr>
<tr>
<td align="right">จำนวนเงิน
<input name="text_3" type="text" class="formfield" id="text_3" value="<?php echo $row_Recordset1['text_3']; ?>" size="25" maxlength="255" required/></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td colspan="3"> </td>
</tr>
<tr>
<td height="33" colspan="3"> </td>
</tr>
<tr>
<td height="102" colspan="5" align="right"><img src="images/heading.jpg" alt="heading" width="731" height="96" align="absbottom" /></td>
</tr>
<tr>
<td width="87" align="left"><strong>ท่านเป็น</strong></td>
<td colspan="4" align="right">
<input name="RadioGroup2" type="radio" id="radio_1" value="Medicine" required/>
แพทย์
<input name="RadioGroup2" type="radio" id="radio_2" value="Nurse" required/>
พยาบาล
<input name="RadioGroup2" type="radio" id="radio_3" value="Academic" required/>
นักวิชาการ
<input name="RadioGroup2" type="radio" id="radio_4" value="Other" required/>
อื่นๆ
<input name="text_4" type="text" class="formfield" id="text_4" value="<?php echo $row_Recordset1['text_4']; ?>" size="49" maxlength="255" required/></td>
</tr>
<tr>
<td> </td>
<td width="84"> </td>
<td width="1"> </td>
<td colspan="2"> </td>
</tr>
<tr>
<td colspan="2" align="left">ชื่อ..(โปรดระบุคำนำหน้า)</td>
<td colspan="3" align="right"><input name="text_5" type="text" class="formfield" id="text_5" value="<?php echo $row_Recordset1['text_5']; ?>" size="84" maxlength="255" required/></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td colspan="2"> </td>
</tr>
</table>
<table width="729" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td colspan="5">โรงพยาบาล
<input name="text_6" type="text" class="formfield" id="text_6" value="<?php echo $row_Recordset1['text_6']; ?>" size="40" maxlength="255" required/></td>
<td colspan="5" align="right">แผนก/หน่วย/ภาควิชา
<input name="text_7" type="text" class="formfield" id="text_7" value="<?php echo $row_Recordset1['text_7']; ?>" size="29" maxlength="255" required/></td>
</tr>
<tr>
<td width="50"> </td>
<td width="50"> </td>
<td width="50"> </td>
<td width="50"> </td>
<td width="50"> </td>
<td width="50"> </td>
<td width="50"> </td>
<td width="50"> </td>
<td width="50"> </td>
<td width="70"> </td>
</tr>
</table>
<table width="729" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="266">เลขใบประกอบวิชาชีพ (แพทย์ / พยาบาล)</td>
<td width="417" align="right"><input name="text_8" type="text" class="formfield" id="text_8" value="<?php echo $row_Recordset1['text_8']; ?>" size="71" maxlength="255" required/></td>
</tr>
<tr>
<td colspan="3"> </td>
</tr>
</table>
<table width="729" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="169">เลขที่สมาชิกสภาพยาบาล</td>
<td width="514" colspan="7" align="right"><input name="text_9" type="text" class="formfield" id="text_9" value="<?php echo $row_Recordset1['text_9']; ?>" size="87" maxlength="255" required/></td>
</tr>
<tr>
<td colspan="8"> </td>
</tr>
</table>
<table width="729" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="99">ที่อยู่ที่ติดต่อได้</td>
<td width="612" colspan="8" align="right"><input name="text_10" type="text" class="formfield" id="text_10" value="<?php echo $row_Recordset1['text_10']; ?>" size="98" maxlength="255" required/></td>
</tr>
<tr>
<td colspan="9"> </td>
</tr>
</table>
<table width="729" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="41">มือถือ</td>
<td width="642" align="right"><input name="text_11" type="text" class="formfield" id="text_11" value="<?php echo $row_Recordset1['text_11']; ?>" size="108" maxlength="255" required/></td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
</table>
<table width="729" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="295">โทรศัพท์
<input name="text_12" type="text" class="formfield" id="text_12" value="<?php echo $row_Recordset1['text_12']; ?>" size="35" maxlength="255" required/></td>
<td width="388" align="right">โทรสาร
<input name="text_13" type="text" class="formfield" id="text_13" value="<?php echo $row_Recordset1['text_13']; ?>" size="53" maxlength="255" required/></td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
</table>
<table width="729" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="42">E-mail: </td>
<td width="641" align="right"><input name="text_14" type="email" class="formfield" id="email" value="<?php echo $row_Recordset1['text_14']; ?>" size="108" maxlength="255" required/></td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
</table>
<table width="729" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="290">หากสนับสนุนโดยบริษัท (โปรดระบุ) ชื่อผู้แทน</td>
<td width="393" align="right"><input name="text_15" type="text" class="formfield" id="text_15" value="<?php echo $row_Recordset1['text_15']; ?>" size="66" maxlength="255" required/></td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
</table>
<table width="729" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="52">โทรศัพท์</td>
<td width="631" align="right"><input name="text_16" type="text" class="formfield" id="text_16" value="<?php echo $row_Recordset1['text_16']; ?>" size="105" maxlength="255" required/></td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
</table>
<table width="729" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="123"><strong><u>รับประเภทอาหาร</u></strong></td>
<td width="15"> </td>
<td width="51">
<input name="RadioGroup1" type="radio" id="radio_5" value="Thailand" required/>
ไทย</td>
<td width="1"> </td>
<td width="76">
<input type="radio" name="RadioGroup1" value="Vegetarian" id="radio_6" required/>
มังสวิรัติ</td>
<td width="101">
<input type="radio" name="RadioGroup1" value="Islam" id="radio_7" required/>
อิสลาม</td>
<td width="216"> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td colspan="2"> </td>
<td> </td>
<td> </td>
</tr>
</table>
<table width="729" border="4" align="center" cellpadding="0" cellspacing="0" class="blueborder_two">
<tr>
<td colspan="6"><table border="0" cellspacing="0" cellpadding="0" width="692">
<tr>
<td width="347" valign="top"><p align="center"><strong>อัตราค่าลงทะเบียน (บาท)</strong></p></td>
<td width="95" valign="top"><p align="center"><strong><u>ก่อน</u></strong><strong> </strong><br />
<strong>15 มี.ค.57</strong></p></td>
<td width="104" valign="top"><p align="center"><strong><u>ตั้งแต่</u></strong><strong> </strong><strong> </strong><br />
<strong>15 มี.ค.57</strong></p></td>
<td width="95" valign="top"><p align="center"><strong><u>หน้างาน</u></strong></p></td>
</tr>
</table></td>
</tr>
<tr>
<td colspan="6"><table border="0" cellspacing="0" cellpadding="0" width="692">
<tr>
<td height="37" colspan="4" valign="middle"><span class="numbertext"><strong><img src="images/space.jpg" width="6" height="9" alt="space" />1</strong></span><strong>. <span class="numbertext">Pre-congress workshops</span> (เลือกได้ 1 หัวข้อเท่านั้น)</strong></td>
</tr>
<tr valign="middle">
<td width="341" height="15" class="numbertext"><input type="radio" name="RadioGroup3" value="1" id="RadioGroup3_0" required/>
<strong>1</strong></td>
<td width="93" class="numbertext"><input type="radio" name="RadioGroup4" value="2000" id="RadioGroup4_0" required/>
2000</td>
<td width="95" class="numbertext"><label>
<input type="radio" name="RadioGroup4" value="2300" id="RadioGroup4_1" required/>
2300</label></td>
<td width="77"><input type="radio" name="RadioGroup4" value="2800" id="RadioGroup4_2" required/>
<span class="numbertext">2800</span></td>
</tr>
<tr valign="middle">
<td height="40" class="numbertext"><input type="radio" name="RadioGroup3" value="2 " id="RadioGroup3_1" required/>
<strong>2
<label>
<input type="radio" name="RadioGroup3" value="3" id="RadioGroup3_2" required/>
<strong>3</strong></label>
<input type="radio" name="RadioGroup3" value="4" id="RadioGroup3_3" required/>
<strong>4</strong></strong></td>
<td width="93" class="numbertext"><input type="radio" name="RadioGroup5" value="1000" id="RadioGroup5_0" required/>
1000</td>
<td width="95" class="numbertext"><input type="radio" name="RadioGroup5" value="1300" id="RadioGroup5_1" required/>
1300</td>
<td width="77" class="numbertext"><label>
<input type="radio" name="RadioGroup5" value="1800" id="RadioGroup5_2" required/>
1800</label></td>
</tr>
</table></td>
</tr>
<tr>
<td colspan="6"><table border="0" cellspacing="0" cellpadding="0" width="692">
<tr>
<td height="37" colspan="4" valign="middle"><strong> <span class="numbertext"><img src="images/space.jpg" width="6" height="9" alt="space" />2</span>. ประชุมวิชาการ <span class="numbertext">(Main Congress) </span></strong></td>
</tr>
<tr valign="middle">
<td width="341" height="30"><strong> <img src="images/space.jpg" width="6" height="9" alt="space" /><img src="images/bullet.jpg" width="8" height="8" alt="bullet" /> เป็นสมาชิกสมาคมเวชศาสตร์มารดาฯเลขที่......</strong></td>
<td width="93" class="numbertext"><input type="radio" name="RadioGroup6" value="1700" id="RadioGroup6_0" required/>
1700</td>
<td width="96" class="numbertext"><label>
<input type="radio" name="RadioGroup6" value="2000" id="RadioGroup6_1" required/>
2000</label></td>
<td width="76" class="numbertext"><strong>
<input type="radio" name="RadioGroup6" value="2500" id="RadioGroup6_2" required/>
</strong>2500</td>
</tr>
<tr valign="middle">
<td height="30"><strong><img src="images/space.jpg" width="6" height="9" alt="space" /><img src="images/bullet.jpg" width="8" height="8" alt="bullet" /></strong><strong>ไม่ได้เป็นสมาชิกสมาคมเวชศาสตร์มารดาฯ</strong><strong> </strong></td>
<td width="93" class="numbertext"><label>
<input type="radio" name="RadioGroup7" value="2200" id="RadioGroup7_0" required/>
2200</label></td>
<td width="96" class="numbertext"><label>
<input type="radio" name="RadioGroup7" value="2500" id="RadioGroup7_1" required/>
2500</label></td>
<td width="76" class="numbertext"><input type="radio" name="RadioGroup7" value="3000" id="RadioGroup7_2" required/>
3000</td>
</tr>
<tr valign="middle">
<td height="30"><strong><img src="images/space.jpg" width="6" height="9" alt="space" /><img src="images/bullet.jpg" width="8" height="8" alt="bullet" /> สำหรับ Resident / Fellow</strong></td>
<td class="numbertext"><input type="radio" name="RadioGroup8" value="800" id="RadioGroup8_0" required/>
800</td>
<td class="numbertext"><input type="radio" name="RadioGroup8" value="1000" id="RadioGroup8_1" required/>
1000</td>
<td class="numbertext"><input type="radio" name="RadioGroup8" value="1500" id="RadioGroup8_2" required/>
1500</td>
</tr>
</table></td>
</tr>
<tr>
<td colspan="6"><table border="0" cellspacing="0" cellpadding="0" width="692">
<tr>
<td height="37" colspan="5" valign="middle"><span class="numbertext"><strong><img src="images/space.jpg" width="6" height="9" alt="space" />3</strong></span><strong>. </strong><strong>สมัครสมาชิกสมาคมฯ ตลอดชีพ</strong></td>
</tr>
<tr>
<td width="250" height="50" valign="top" class="numbertext"><em class="bluetext"><img src="images/space.jpg" width="6" height="9" alt="space" />(ดาวน์โหลดใบสมัครสมาชิกสมาคมฯ และส่ง<img src="images/space.jpg" width="6" height="9" alt="space" />มาพร้อมกับใบลงทะเบียนประชุม)</em></td>
<td width="80" valign="top" class="numbertext"> </td>
<td width="90"><label>
<input type="radio" name="RadioGroup9" value="800 " id="RadioGroup9_0" required/>
<span class="numbertext">800</span></label>
<br />
</td>
<td width="95" class="numbertext"><label>
<input type="radio" name="RadioGroup9" value="800 " id="RadioGroup9_1" required/>
800</label>
<br />
</td>
<td width="71"><span class="numbertext">
<label>
<input type="radio" name="RadioGroup9" value="800" id="RadioGroup9_2" required/>
800</label>
<br />
<strong></strong></span></td>
</tr>
</table></td>
</tr>
<tr>
<td colspan="6"><table width="692" border="0" cellpadding="0" cellspacing="0">
<tr>
<?php
$sql = 'UPDATE regform SET `total` = `radio_12` + `radio_15` + `radio_18` + `radio_21` +`radio_24` + `radio_27`';
?>
<td height="46" align="right"><strong>รวมค่าลงทะเบียน ข้อ <span class="numbertext">1+2+3</span>
<input name="text_17" type="text" class="formfield" id="text_17" value="<?php echo $row_Recordset1['total']; ?>" maxlength="255" required/>
<em><strong>บาท</strong></em></strong></td>
</tr>
</table></td>
</tr>
</table>
<table width="729" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td>ต้องการให้ออกใบเสร็จในนาม (ระบุ) </td>
<td align="right"><input name="text_18" type="text" class="formfield" id="text_18" value="<?php echo $row_Recordset1['text_18']; ?>" size="76" maxlength="255" required/></td>
</tr>
</table>
<table width="729" border="0" align="center" cellpadding="5" cellspacing="0">
<tr>
<td colspan="2"> </td>
<td width="63"> </td>
</tr>
<tr>
<td colspan="3"><strong class="yellowhighlight"><u>การชำระเงิน</u></strong> <u> เมื่อสมาคมฯได้รับชำระเงินแล้วเท่านั้น จึงถือว่าการลงทะเบียนสมบูรณ์ </u></td>
</tr>
<tr>
<td width="26" valign="top"><input type="radio" name="RadioGroup10" value="Bank Transfer" id="RadioGroup10_0" required/>
<span class="paymenttext">Bank Transfer</span></td>
<td colspan="2">โอนเข้าบัญชี “ <u>วิชาการสมาคมเวชศาสตร์มารดาและทารกในครรภ์ (ไทย)”</u> ธนาคารกรุงไทย บัญชีออมทรัพย์ <br />
เลขที่ <u>041-0-08598-7</u> สาขา <u>ถนนเพชรบุรีตัดใหม่</u></td>
</tr>
<tr>
<td valign="top"><input type="radio" name="RadioGroup10" value="Money Order" id="RadioGroup10_1" required/>
<span class="paymenttext">Money Order</span></td>
<td colspan="2"><label>ธนาณัติสั่งจ่าย</label>
<u>ปณ. เพชรบุรีตัดใหม่ </u><u>10311</u> ในนาม <u>ศ.นพ.เยื้อน ตันนิรันดร</u> และส่งธนาณัติตัวจริงพร้อมใบลงทะเบียน <br />
มายังสมาคมฯ</td>
</tr>
<tr>
<td valign="top"><input type="radio" name="RadioGroup10" value="Cheque" id="RadioGroup10_2" required/>
<span class="paymenttext">Cheque</span></td>
<td colspan="2"> เช็คสั่งจ่าย(เช็คต่างจังหวัดเพิ่มค่าธรรมเนียม 30 บาท) บัญชี<u>วิชาการสมาคมเวชศาสตร์มารดาและทารกในครรภ์</u><u>(ไทย)</u></td>
</tr>
<tr>
<td valign="top"><input type="radio" name="RadioGroup10" value="Cash" id="RadioGroup10_3" required/>
<span class="paymenttext">Cash</span></td>
<td width="579"><label>เงินสด</label>
ณ สำนักงานสมาคมฯ<br />
<span class="bluetext">กรุณาส่งหลักฐานการชำระเงินพร้อมกับใบสมัครลงทะเบียนประชุมวิชาการ มายังสมาคมฯ โทรสาร : 02-7181488 หรือทาง<br />
E-mail : mfm_th#yahoo.com, por.boon#hotmail.com </span></td>
<td> </td>
</tr>
<tr>
<td colspan="3" valign="top"><span class="redtext"><strong class="yellowhighlight"><em><u>หมายเหตุ</u></em></strong> </span>
<ol>
<li class="redtext">ลงทะเบียน Workshop ต้องลงทะเบียนประชุมวิชาการด้วย และเลือกได้ 1 Workshop เท่านั้น </li>
<li class="redtext">ผู้สมัครเข้าเป็นสมาชิกใหม่ สามารถลงทะเบียนใช้อัตราสมาชิกได้เลย</li>
<li class="redtext">ผู้ลงทะเบียนหน้างาน อาจไม่ได้รับความสะดวก กระเป๋าและเอกสารประกอบการประชุมอาจไม่ครบถ้วน </li>
<li class="redtext"><strong><u>การยกเลิกการลงทะเบียน</u></strong> ผู้ที่ยกเลิกการลงทะเบียนจะต้องส่งหนังสือขอยกเลิกลงทะเบียนเป็นลายลักษณ์อักษรมายังสมาคมฯ โดยจะได้รับคืนค่าลงทะเบียนภายหลังเสร็จสิ้นงานดังนี้ </li>
</ol>
<p><span class="redtext">ก่อนวันที่ 10 เมษายน 2557 คืนร้อยละ 50 ของค่าลงทะเบียน <br />
หลังวันที่ 10 เมษายน 2557 ไม่คืนค่าลงทะเบียน</span><br />
<strong> </strong><strong><em><u> </u></em></strong><br />
<strong><u>ส่งใบลงทะเบียน, ชำระค่าลงทะเบียน และสอบถามเพิ่มเติมได้ที่</u></strong><strong><u> </u></strong><br />
คุณพรธวัล บุญชนะทองเลิศ <br />
สมาคมเวชศาสตร์มารดาและทารกในครรภ์ (ไทย) <br />
อาคารเฉลิมพระบารมี ๕๐ ปี ชั้น 8 เลขที่ 2 ซอยศูนย์วิจัย ถ.เพชรบุรีตัดใหม่ <br />
แขวงบางกะปิ เขตห้วยขวาง กรุงเทพฯ 10310<br />
โทร. 02-7181489 มือถือ 087-6957659 โทรสาร. 02-7181488 <br />
E-mail : por.boon#hotmail.com หรือ mfm_th#yahoo.com <br />
Website : www.thai-smfm.com</p></td>
</tr>
<tr>
<td colspan="3" valign="top"><img src="images/bottomtext.jpg" width="728" height="359" alt="bottomimage" /></td>
</tr>
<tr>
<td colspan="3" align="center" valign="top"><strong class="bottomtext">ดาวน์โหลดแบบฟอร์มจองที่พักได้ที่ www.thai-smfm.com</strong></td>
</tr>
<tr>
<td colspan="3" align="center" valign="top"><input name="submit" type="submit" class="submit" id="submit" value="Click Here to Register Now" onclick="location.href='http://localhost/registerform/regconfirm.html'"/>
</tr>
</table></td>
<td width="83"><p>
<input type="button" name="clear" value="Clear Form" onclick="clearForm(this.form);">
<input type="hidden" name="MM_insert" value="form" />
</p>
</form>
<
/body>
You can redirect to a html page with php when your code is done with writing to the database. The action tag should direct to the php file where your code handles the form data.
I hope i explained well.
cheers!
Send the form to action= "".
Once the data is saved in database, redirect the form to confirmation page through php.
Syntax for redirect in php :
header('Location:http://yourdomain.com/registerform/regconfirm.html');
exit;
Instead of using "regconfirm.html" create a "regconfirm.php"
Perform your database operation here.
once done regconfirm.php will show confirmation text.
example of form submit would be
< form action ="regconfirm.php" >
// Your Form Here
</form >
First of all, I already know about how mysql_connect are not advisable to use but i have no time to learn the PDO commands and once I solve this first, i will change it to PDO. But now, im still having trouble merging two codes with different database connection on each file.
<?php
$dbh1 = mysql_connect('localhost', 'root', '');
$dbh2 = mysql_connect('localhost', 'root', '', true);
mysql_select_db('invoices', $dbh1);
mysql_select_db('hmis', $dbh2);
$id = '17';
/////
if ($id) {
echo "<h1>Edit Medical Records # : $id</h1>";
}
else
{
echo " <h1>Medical Records</h1>";
}
if($submit)
{
//-------------------check user name-----------------------------------------------------
$name = $_POST['name'];
$select = "select first_name from patient where last_name = '".$last_name."';";
$query = mysql_query($select,$dbh1) or die ("Mysql error! It was: ".mysql_error());
$rows = mysql_num_rows($query);
if ($rows != 0)
{
echo ("<script language=javascript>alert ('Sorry! $first_name is already taken!')</script>");
echo ("<script language=javascript>document.location.href = 'editclient.php'</script>");
exit;
}
if($name == "admin"){
echo ("<script language=javascript>alert ('Sorry! $first_name is not a good thing to do!')</script>");
echo ("<script language=javascript>document.location.href = 'editclient.php'</script>");
exit;
}
//-----------------------------------end check-------------------------------------------
$sql = "INSERT INTO patient (`first_name`, `last_name`,`country`, `address`, `gender`, `telno`, `occ`, `spo`, `occ2`,`cp`, `tel2`, `reff`, `all`, `ill`, `mat`, `frat`, `datetime`, `vs`,`ppe`, `ffup`)
VALUES ('$first_name','$last_name','$country','$address','$gender','$telno','$occ','$spo','$occ2', '$cp','$tel2','$reff','$all','$ill','$mat','$frat','$datetime','$vs','$ppe','$ffup')";
$result = mysql_query($sql,$dbh1);
//echo ("<script language=javascript>document.location.href = 'editclient.php?id=$id&message=Patient $id has been Created!'</script>");
echo ("<SCRIPT LANGUAGE='JavaScript'>
window.alert('Succesfully Updated')
window.location.href='sample4.php';
</SCRIPT>");
}
else if($update)
{
$sql = "UPDATE patient set first_name='$first_name',last_name='$last_name',
country='$country',address='$address',gender='$gender',telno='$telno',
occ='$occ',spo='$spo',occ2='$occ2', cp='$cp', tel2='$tel2',reff='$reff', ill='$ill', mat='$mat', frat='$frat', datetime='$datetime', vs='$vs', ppe='$ppe' ,ffup='$ffup'
WHERE clientid=$id";
$result = mysql_query($sql ,$dbh1);
//echo ("<script language=javascript>document.location.href = 'editclient.php?id=$id&message=Client $id has been Updated!'</script>");
echo ("<SCRIPT LANGUAGE='JavaScript'>
window.alert('Succesfully Updated')
window.location.href='sample4.php';
</SCRIPT>");
}
else if($id)
{
$result = mysql_query("SELECT * FROM patient WHERE clientid=$id",$dbh1);
$row = mysql_fetch_array($result);
?>
</p>
<br><font color=red size=4><?php if (isset($_GET['message'])) { echo ' - '.$_GET['message']; } ?></font><BR>
<?
//-------------NEXT PREVIOUS----------------------------------------------------------------------
$sql ="SELECT * FROM patient WHERE clientid < '$id' ORDER by clientid DESC LIMIT 1";
$resultp = mysql_query($sql ,$dbh1);
$previousrows = mysql_num_rows($resultp);
while ($prerow = mysql_fetch_array($resultp)) {
$prev=$prerow['clientid'];
}
//echo $prev;
$sql2 ="SELECT clientid FROM patient WHERE clientid > '$id' ORDER by clientid ASC LIMIT 1";
$resultn = mysql_query($sql2,$dbh1);
$nextrows = mysql_num_rows($resultn);
while ($nextrow = mysql_fetch_array($resultn)) {
$next=$nextrow['clientid'];
}
//echo $next;
if ($previousrows == "") {
echo "";
}else{
echo "<B><a href=$PHP_SELF?id=$prev>$prev <- Prev</a> | ";
}
echo "<font size=6><B>$id</B></font>";
if ($nextrows == "") {
echo "";
}else{
echo "<b> | <a href=$PHP_SELF?id=$next > Next -> $next</a></b>";
}
//-----------------end next prev-----------------------------------------------------
?><br><br>
<?php include("inc/nav.inc");?>
<form name="form2a" method="post" action="<?php echo $PHP_SELF?>">
<table width="760" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class=topHeadrow1 valign="middle" width="50%" colspan="2">
Edit Patient Information:</td>
<td class=topHeadrow1 valign="middle" width="10" rowspan="20">
</td>
<td class=topHeadrow1 valign="middle" width="50%">
Procedures:</td>
</tr>
<tr>
<td valign="top" align="right">
<input type="hidden" name="id" value="<?php echo $row["clientid"]?>">
First name:<br>
</td>
<td valign="top" align="left">
<input type="text" size="20" name="first_name" value="<?php echo $row["first_name"]?>" ></td>
<td valign="top" width="10%" rowspan="13">
<!-- edit include inv -->
<?php //include ('testinclude.php'); ?>
<!-- END -->
</td>
</tr>
<tr>
<td valign="top" align="right">
Last Name:
</td>
<td valign="top" align="left">
<input type="text" name="last_name" size="20" value="<?php echo $row["last_name"]?>"></td>
</tr>
<tr>
<td valign="top" align="right"> Gender:</td>
<td valign="top" align="left"><select name="gender">
<option value="Male">Male</option>
<option value="Female">Female</option> </select>
</td>
</tr>
<tr>
<td valign="top" align="right"> Country:</td>
<td valign="top" align="left">
<select name="country" >
<option value="Afghanistan">Afghanistan</option>
<option value="Bahrain">Bahrain</option>
<option value="Bangladesh">Bangladesh</option>
<option value="Bhutan">Bhutan</option>
<option value="Brunei">Brunei</option>
<option value="Cambodia">Cambodia</option>
<option value="China">China</option>
<option value="Malaysia">Malaysia</option>
<option value="Maldives">Maldives</option>
<option value="Mongolia">Mongolia</option>
<option value="Myanmar">Myanmar (Burma)</option>
<option value="Pakistan">Pakistan</option>
<option value="Philippines">Philippines</option>
<option value="Saudi Arabia">Saudi Arabia</option>
<option value="Singapore">Singapore</option>
<option value="Sri Lanka">Sri Lanka</option>
<option value="Syria">Syria</option>
<option value="UAE">United Arab Emirates</option>
<option value="Uzbekistan">Uzbekistan</option>
</select>
</tr>
<tr>
<td valign="top" align="right">
Tel. no.:</td>
<td valign="top" align="left">
<input
type="text" size="20" name="telno" placeholder="###-####" value="<?php echo $row["telno"]?>"></td></tr>
<tr>
<td valign="top" align="right">
Occupation:</td>
<td valign="top" align="left">
<input
type="text" size="20" name="occ" value="<?php echo $row["occ"]?>"></td></tr>
<tr>
<td align="right">
Spouse:</td>
<td >
<input
type="text" size="20" name="spo" value="<?php echo $row["spo"]?>"></td></tr><tr>
<td align="right">
Occupation:</td>
<td >
<input
type="text" size="20" name="occ2" value="<?php echo $row["occ2"]?>"></td></tr>
<tr>
<td align="right" width="20">
Contact Person(in case of emergency):</td>
<td >
<input
type="text" size="20" name="cp" value="<?php echo $row["cp"]?>"></td></tr><tr>
<td align="right">
Tel. no:</td>
<td >
<input
type="text" size="20" name="tel2" value="<?php echo $row["tel2"]?>"></td></tr>
<tr>
<td valign="top" align="right" nowrap>
Address:</td>
<td valign="top" align="left">
<input type="text" name="address" value="<?php echo $row["address"]?>" size="31"></td>
</tr>
<tr>
<td valign="top" align="right" nowrap>
Reffered By:</td>
<td valign="top" align="left">
<input type="text" name="reff" value="<?php echo $row["reff"]?>" size="31" ></td>
</tr>
<tr>
<td class=topHeadrow1 valign="middle" width="50%" colspan="2">
Past Medical History:</td>
</tr>
<tr>
<td valign="top" align="right" nowrap>
Allergy:</td>
<td valign="top" align="left">
<input type="text" name="all" value="<?php echo $row["all"]?>" size="31"></td>
</tr>
<tr>
<td valign="top" align="right" nowrap>
Previous illness:</td>
<td valign="top" align="left">
<input type="text" name="ill" value="<?php echo $row["ill"]?>" size="31"></td>
</tr>
<tr>
<td class=topHeadrow1 valign="middle" width="50%" colspan="2">
<b><font size="4">
Heredo-Familial Diseases:</font></b></td>
</tr>
<tr>
<td valign="top" align="right" nowrap>
Maternal:
</td>
<td valign="top" align="left">
<input type="text" name="mat" value="<?php echo $row["mat"]?>" size="20"></td>
</tr>
<tr>
<td valign="top" align="right" nowrap>
Fraternal:
</td>
<td valign="top" align="left">
<input type="text" name="frat" value="<?php echo $row["frat"]?>" size="20"></td>
</tr>
<tr>
<td class=topHeadrow1 valign="middle" width="50%" colspan="2">
<b><font size="4">
Examination:</font></b></td>
</tr>
<tr>
<td valign="top" align="right" nowrap>
Date / Time:</td>
<td valign="top" align="left">
<input type="text" name="datetime" value="<?php echo $row["datetime"]?>" size="31"></td>
</tr>
<tr>
<td valign="top" align="right" nowrap>
Vital Signs:</td>
<td valign="top" align="left">
<input type="text" name="vs" value="<?php echo $row["vs"]?>" size="31"></td>
</tr>
<tr>
<td align="center" nowrap>
Complain PPE Findings:</td>
<td valign="top" align="left">
<input type="text" name="ppe" value="<?php echo $row["ppe"]?>" size="31"></td>
</tr>
<tr>
<td align="center" nowrap>
Plan / Management / FF-UP</td>
<td valign="top" align="left">
<input type="text" name="ffup" value="<?php echo $row["ffup"]?>" size="31"></td>
</tr>
<tr>
<td class=topHeadrow1 valign="middle" width="100%" colspan="4">
<p align="center"><input class="form-button" type="Submit" name="update" value="Update Information"></td>
</tr>
<tr>
<td valign="top" width="100%" colspan="4">
<br>
</td>
</tr>
</table>
</form>
<?
}
else
{
//----------------------------begin add client--------------------------------------------------------
?>
<br><font color=red size=4><?php if (isset($_GET['message'])) { echo ' - '.$_GET['message']; } ?></font><BR>
<form name="form2b" method="post" action="editclient.php" onSubmit="return checkPw(this)">
<table>
<tr>
<td class="topHeadrow5" valign="top" width="100%" colspan="5">
<b><font size="4">Patient Information:</font></b></td>
</tr>
<tr>
<td valign="top" align="right">
First Name:</td>
<td valign="top" align="left">
<input
type="text" size="20" name="first_name" ></td></tr>
<tr>
<td valign="top" align="right">
Last Name:</td>
<td valign="top" align="left">
<input type="text" name="last_name" size="20"></td></tr>
<tr>
<td valign="top" align="right"> Gender:</td>
<td valign="top" align="left"><select name="gender">
<option value="Male">Male</option>
<option value="Female">Female</option> </select>
</td>
</tr>
<tr>
<td valign="top" align="right">Country:</td>
<td valign="top" align="left">
<select name="country" >
<option value="Afghanistan">Afghanistan</option>
<option value="Bahrain">Bahrain</option>
<option value="Bangladesh">Bangladesh</option>
<option value="Bhutan">Bhutan</option>
<option value="Brunei">Brunei</option>
<option value="Cambodia">Cambodia</option>
<option value="China">China</option>
<option value="Malaysia">Malaysia</option>
<option value="Maldives">Maldives</option>
<option value="Mongolia">Mongolia</option>
<option value="Myanmar">Myanmar (Burma)</option>
<option value="Pakistan">Pakistan</option>
<option value="Philippines">Philippines</option>
<option value="Saudi Arabia">Saudi Arabia</option>
<option value="Singapore">Singapore</option>
<option value="Sri Lanka">Sri Lanka</option>
<option value="Syria">Syria</option>
<option value="UAE">United Arab Emirates</option>
<option value="Uzbekistan">Uzbekistan</option>
</select>
</tr>
<tr>
<td valign="top" align="right">
Tel. no.:</td>
<td valign="top" align="left">
<input
type="text" size="20" name="telno" placeholder="###-####"></td></tr>
<tr>
<td valign="top" align="right">
Occupation:</td>
<td valign="top" align="left">
<input
type="text" size="20" name="occ" ></td></tr>
<tr>
<td align="right">
Spouse:</td>
<td >
<input
type="text" size="20" name="spo" ></td>
<td align="right">
Occupation:</td>
<td >
<input
type="text" size="20" name="occ2" ></td></tr>
<tr>
<td align="right" width="20">
Contact Person(in case of emergency):</td>
<td >
<input
type="text" size="20" name="cp" ></td>
<td align="right">
Tel. no:</td>
<td >
<input
type="text" size="20" name="tel2" ></td></tr>
<tr>
<td valign="top" align="right" nowrap>
Address:</td>
<td valign="top" align="left">
<input type="text" name="address" size="50"></td>
</tr>
<tr>
<td valign="top" align="right" nowrap>
Reffered By:</td>
<td valign="top" align="left">
<input type="text" name="reff" size="31"></td>
</tr>
<tr>
<td class="topHeadrow5" valign="top" width="200" colspan="5">
<b><font size="4">
Past Medical History:</font></b></td>
</tr>
<tr>
<td valign="top" align="right" nowrap>
Allergy:</td>
<td valign="top" align="left">
<input type="text" name="all" size="31"></td>
</tr>
<tr>
<td valign="top" align="right" nowrap>
Previous illness:</td>
<td valign="top" align="left">
<input type="text" name="ill" size="31"></td>
</tr>
<tr>
<td class="topHeadrow5" valign="top" width="100%" colspan="5">
<b><font size="4">
Heredo-Familial Diseases:</font></b></td>
</tr>
<tr>
<td valign="top" align="right" nowrap>
Maternal:
</td>
<td valign="top" align="left">
<input type="text" name="mat" size="20"></td>
</tr>
<tr>
<td valign="top" align="right" nowrap>
Fraternal:
</td>
<td valign="top" align="left">
<input type="text" name="frat" size="20"></td>
</tr>
<tr>
<td class="topHeadrow5" valign="top" width="100%" colspan="5">
<b><font size="4">
Examination:</font></b></td>
</tr>
<tr>
<td valign="top" align="right" nowrap>
Date / Time:</td>
<td valign="top" align="left">
<input type="text" name="datetime" size="31"></td>
</tr>
<tr>
<td valign="top" align="right" nowrap>
Vital Signs:</td>
<td valign="top" align="left">
<input type="text" name="vs" size="31"></td>
</tr>
<tr>
<td align="center" nowrap>
Complain PPE Findings:</td>
<td valign="top" align="left">
<input type="text" name="ppe" size="31"></td>
</tr>
<tr>
<td align="center" nowrap>
Plan / Management / FF-UP</td>
<td valign="top" align="left">
<input type="text" name="ffup" size="31"></td>
</tr>
<tr>
<td width="10%"> </td>
<td width="90%"><input class="form-button" type="Submit" name="submit" value="Enter information"></td>
</tr>
</table>
</form>
<p> </p>
<?
}
?>
The result of the above code is on the screenshot above. I commented out the `include ('testinclude.php'). But once I include that file, all the data on the patient information is gone BUT the procedures column looks gone. I want both of them to show up.
When I include the testinclude.php. This is the result:
testinclude.php
<?
$id = '17';
//printf("<td align=left><font face=Verdana size=1 color=red>There are no Records</font></td>",$num); //prints number
$procedures = "SELECT * FROM incurredcharges WHERE patient_no = '$id'";
$result = mysql_query($procedures ,$dbh2);
if (mysql_num_rows($result) >= 1){
$procedures = "SELECT
`incurredcharges`.`procedure_no`,
`c`.`procedure`
FROM
incurredcharges
INNER JOIN (
SELECT `procedure`, `procedure_no` FROM `charges`
UNION ALL
SELECT `confinement`, `procedure_no` FROM `confinement`
UNION ALL
SELECT `service`, `procedure_no` FROM `ultrasound`
) c ON `incurredcharges`.`procedure_no` = c.`procedure_no`
WHERE `incurredcharges`.`patient_no` = '$id'";
$result2 = mysql_query($procedures ,$dbh2);
echo "<p><table border=1 cellspacing=0 cellpadding=2 bordercolor=#000000 width=100%>";
echo "<tr align=top>
<td class=topHeadrow5><b>Procedure #</b></td>
<td class=topHeadrow5><b>Charge Incurred</b></td></tr>";
while($row = mysql_fetch_array($result2)){
echo '
<tr>
<td>'.$row[0].'</td>
<td>'.$row[1].'</td>';
echo "</tr>";
}
echo '</table>';
}
else {
echo "<p><table border=1 cellspacing=0 cellpadding=2 bordercolor=#000000 width=100%>";
echo "<tr align=top>
<td class=topHeadrow4><b>There are no Records</b></td></tr></table>";
return false;
}
?>
I already used the trick on connecting multiple databases. Every mysql_query, I specified what dtabase config it corresponds to. But it still doesnt work.
EDIT:
OK I just tried moving the include('testinclude.php') at the bottom. AND IT WORKED. It shows both the patient info and the procedures..
But in my official codes, it doesnt.
you have to create link for each database and pass that link to query
$link1 = mysql_select_db('invoices', $dbh1);
$link2 = mysql_select_db('hmis', $dbh2);
$sql1 = mysql_query($query1,$link1);
$sql2 = mysql_query($query2,$link2);
Please refer the below code,
$dbh1 = mysql_connect($hostname, $username, $password);
$dbh2 = mysql_connect($hostname, $username, $password, true);
mysql_select_db('database1', $dbh1);
mysql_select_db('database2', $dbh2);
Then to query database 1, do this:
mysql_query('select * from tablename', $dbh1);
and for database 2:
mysql_query('select * from tablename', $dbh2);
While opening second MySql connection, you need to pass 5th argument as true.
Please refer MySql manual,
resource mysql_connect (string $server, string $username,
string $password, bool $new_link = false )
new_link
If a second call is made to mysql_connect() with the same arguments, no new link will be established, but instead, the link identifier of the already opened link will be returned. The new_link parameter modifies this behavior and makes mysql_connect() always open a new link, even if mysql_connect() was called before with the same parameters. In SQL safe mode, this parameter is ignored.
I hope this helps.
This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.
Closed 10 years ago.
I'm just checking other people's works and Im fixing this design and I can't seem to have an idea on how to fix it. I don't want to change anything from the css so is it possible to just arrange it on html?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Clinical Module</title>
<link href="style.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="inc/style.css" type="text/css">
</head>
<body>
<form action='' method='POST'><center>
<input type="text" placeholder="Patient Number" name="search" > <input type="submit" Value="Check" name='submit'> <br>
<?php
mysql_connect("localhost","root","");
mysql_select_db("invoices");
$search = 0;
$search=$_POST['search'];
if (isset($_POST['submit'])){
$query = "select * from `patient` where `clientid` = $search ";
$result=mysql_query($query);
while($row = mysql_fetch_array($result)){ ?>
First name:<br>
</td>
<td valign="top" align="left">
<input type="text" size="20" name="first_name" value="<?php echo $row["first_name"]?>" ></td>
<td valign="top" width="10%" rowspan="13">
</td>
</tr>
<tr>
<td valign="top" align="right">
Middle name:</td>
<td valign="top" align="left">
<input type="text" size="20" name="middle_name" value="<?php echo $row["middle_name"]?>" ></td>
</td>
</tr>
<tr>
<td valign="top" align="right">
Last Name:
</td>
<td valign="top" align="left">
<input type="text" name="last_name" size="20" value="<?php echo $row["last_name"]?>"></td>
</tr>
<tr>
<td valign="top" align="right">
Birthdate
</td>
<td valign="top" align="left">
<input type="text" name="Birthdate" size="20" value="<?php echo $row["birthdate"]; ?>"></td>
</tr>
<tr>
<td valign="top" align="right">
Age
</td>
<td valign="top" align="left">
<input readonly type="text" name="age" size="20" value="<?php echo $row["age"]?>" placeholder="YYYY-MM-DD"></td>
</tr>
<tr>
<td valign="top" align="right"> Gender:</td>
<td valign="top" align="left"><select name="gender">
<? if ($row["gender"]==Male) { ?>
<option value="Male" selected>Male</option>
<option value="Female">Female</option>
<? }else if ($row["gender"]==Female) { ?>
<option value="Male" >Male</option>
<option value="Female" selected>Female</option> <?php }?>
</select></tr>
</td><tr>
<td valign="top" align="right"> Civil Status:</td>
<td valign="top" align="left"><select name="civil_status">
<? if ($row["civil_status"]==Single) { ?>
<option value="Single" selected >Single</option>
<option value="Married">Married</option>
<option value="Separatede">Separated</option>
<option value="Widowed">Windowed</option>
<? }else if ($row["civil_status"]==Married) { ?>
<option value="Single" >Single</option>
<option value="Married" selected>Married</option>
<option value="Separated">Separated</option>
<option value="Widowed">Windowed</option>
<? }else if ($row["civil_status"]==Separated) { ?>
<option value="Single" >Single</option>
<option value="Married">Married</option>
<option value="Separated" selected>Separated</option>
<option value="Widowed">Windowed</option>
<? }else if ($row["civil_status"]==Widowed) { ?>
<option value="Single" >Single</option>
<option value="Married">Married</option>
<option value="Separated">Separated</option>
<option value="Widowed" selected>Windowed</option> <?php }?>
</select>
</td>
</tr>
<tr>
<td valign="top" align="right" nowrap>
Address:</td>
<td valign="top" align="left">
<input type="text" name="address" value="<?php echo $row["address"]?>" size="31"></td>
</tr>
<tr>
<td valign="top" align="right">
Tel. no.:</td>
<td valign="top" align="left">
<input
type="text" size="20" name="telno" placeholder="###-####" value="<?php echo $row["telno"]?>"></td></tr>
<tr>
<td valign="top" align="right">
Occupation:</td>
<td valign="top" align="left">
<input
type="text" size="20" name="occ" value="<?php echo $row["occ"]?>"></td></tr>
<tr>
<td align="right">
Spouse:</td>
<td >
<input
type="text" size="20" name="spo" value="<?php echo $row["spo"]?>"></td></tr><tr>
<td align="right">
Occupation:</td>
<td >
<input
type="text" size="20" name="occ2" value="<?php echo $row["occ2"]?>"></td></tr>
<tr>
<td align="right" width="20">
Contact Person(in case of emergency):</td>
<td >
<input
type="text" size="20" name="cp" value="<?php echo $row["cp"]?>"></td></tr><tr>
<td align="right">
Tel. no:</td>
<td >
<input
type="text" size="20" name="tel2" value="<?php echo $row["tel2"]?>"></td></tr>
<tr>
<td valign="top" align="right" nowrap>
Reffered By:</td>
<td valign="top" align="left">
<input type="text" name="reff" value="<?php echo $row["reff"]?>" size="31" ></td>
</tr>
<tr>
<td class=topHeadrow1 valign="middle" width="50%" colspan="2">
Past Medical History:</td>
</tr>
<tr>
<td valign="top" align="right" nowrap>
Allergy:</td>
<td valign="top" align="left">
<input type="text" name="all" value="<?php echo $row["all"]?>" size="31"></td>
</tr>
<tr>
<td valign="top" align="right" nowrap>
Previous illness:</td>
<td valign="top" align="left">
<input type="text" name="ill" value="<?php echo $row["ill"]?>" size="31"></td>
</tr>
<tr>
<td class=topHeadrow1 valign="middle" width="50%" colspan="2">
<b><font size="4">
Heredo-Familial Diseases:</font></b></td>
</tr>
<tr>
<td valign="top" align="right" nowrap>
Maternal:
</td>
<td valign="top" align="left">
<input type="text" name="mat" value="<?php echo $row["mat"]?>" size="20"></td>
</tr>
<tr>
<td valign="top" align="right" nowrap>
Fraternal:
</td>
<td valign="top" align="left">
<input type="text" name="frat" value="<?php echo $row["frat"]?>" size="20"></td>
</tr>
<? }
}
?>
</center>
</form>
|
I'm not sure if this is what you are referring to, as you've not specified a massive amount of information...
However,
You don't seem to have the actual <table> or </table> tags on this form...
No, opening <tr> tag (as pointed out by Tim Medora Below... Thanks!)...
And also no beginning <td valign="top" align="right"> Before your First name:<br>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Clinical Module</title>
<link href="style.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="inc/style.css" type="text/css">
</head>
<body>
<form action='' method='POST'><center>
<input type="text" placeholder="Patient Number" name="search" > <input type="submit" Value="Check" name='submit'> <br>
<table>
<?php
mysql_connect("localhost","root","");
mysql_select_db("invoices");
$search = 0;
$search=$_POST['search'];
if (isset($_POST['submit'])){
$query = "select * from `patient` where `clientid` = $search ";
$result=mysql_query($query);
while($row = mysql_fetch_array($result)){ ?>
<tr>
<td valign="top" align="right">
First name:<br>
</td>
<td valign="top" align="left">
<input type="text" size="20" name="first_name" value="<?php echo $row["first_name"]?>" ></td>
<td valign="top" width="10%" rowspan="13">
</td>
</tr>
<tr>
<td valign="top" align="right">
Middle name:</td>
<td valign="top" align="left">
<input type="text" size="20" name="middle_name" value="<?php echo $row["middle_name"]?>" ></td>
</td>
</tr>
<tr>
<td valign="top" align="right">
Last Name:
</td>
<td valign="top" align="left">
<input type="text" name="last_name" size="20" value="<?php echo $row["last_name"]?>"></td>
</tr>
<tr>
<td valign="top" align="right">
Birthdate
</td>
<td valign="top" align="left">
<input type="text" name="Birthdate" size="20" value="<?php echo $row["birthdate"]; ?>"></td>
</tr>
<tr>
<td valign="top" align="right">
Age
</td>
<td valign="top" align="left">
<input readonly type="text" name="age" size="20" value="<?php echo $row["age"]?>" placeholder="YYYY-MM-DD"></td>
</tr>
<tr>
<td valign="top" align="right"> Gender:</td>
<td valign="top" align="left"><select name="gender">
<? if ($row["gender"]==Male) { ?>
<option value="Male" selected>Male</option>
<option value="Female">Female</option>
<? }else if ($row["gender"]==Female) { ?>
<option value="Male" >Male</option>
<option value="Female" selected>Female</option> <?php }?>
</select></tr>
</td><tr>
<td valign="top" align="right"> Civil Status:</td>
<td valign="top" align="left"><select name="civil_status">
<? if ($row["civil_status"]==Single) { ?>
<option value="Single" selected >Single</option>
<option value="Married">Married</option>
<option value="Separatede">Separated</option>
<option value="Widowed">Windowed</option>
<? }else if ($row["civil_status"]==Married) { ?>
<option value="Single" >Single</option>
<option value="Married" selected>Married</option>
<option value="Separated">Separated</option>
<option value="Widowed">Windowed</option>
<? }else if ($row["civil_status"]==Separated) { ?>
<option value="Single" >Single</option>
<option value="Married">Married</option>
<option value="Separated" selected>Separated</option>
<option value="Widowed">Windowed</option>
<? }else if ($row["civil_status"]==Widowed) { ?>
<option value="Single" >Single</option>
<option value="Married">Married</option>
<option value="Separated">Separated</option>
<option value="Widowed" selected>Windowed</option> <?php }?>
</select>
</td>
</tr>
<tr>
<td valign="top" align="right" nowrap>
Address:</td>
<td valign="top" align="left">
<input type="text" name="address" value="<?php echo $row["address"]?>" size="31"></td>
</tr>
<tr>
<td valign="top" align="right">
Tel. no.:</td>
<td valign="top" align="left">
<input
type="text" size="20" name="telno" placeholder="###-####" value="<?php echo $row["telno"]?>"></td></tr>
<tr>
<td valign="top" align="right">
Occupation:</td>
<td valign="top" align="left">
<input
type="text" size="20" name="occ" value="<?php echo $row["occ"]?>"></td></tr>
<tr>
<td align="right">
Spouse:</td>
<td >
<input
type="text" size="20" name="spo" value="<?php echo $row["spo"]?>"></td></tr><tr>
<td align="right">
Occupation:</td>
<td >
<input
type="text" size="20" name="occ2" value="<?php echo $row["occ2"]?>"></td></tr>
<tr>
<td align="right" width="20">
Contact Person(in case of emergency):</td>
<td >
<input
type="text" size="20" name="cp" value="<?php echo $row["cp"]?>"></td></tr><tr>
<td align="right">
Tel. no:</td>
<td >
<input
type="text" size="20" name="tel2" value="<?php echo $row["tel2"]?>"></td></tr>
<tr>
<td valign="top" align="right" nowrap>
Reffered By:</td>
<td valign="top" align="left">
<input type="text" name="reff" value="<?php echo $row["reff"]?>" size="31" ></td>
</tr>
<tr>
<td class=topHeadrow1 valign="middle" width="50%" colspan="2">
Past Medical History:</td>
</tr>
<tr>
<td valign="top" align="right" nowrap>
Allergy:</td>
<td valign="top" align="left">
<input type="text" name="all" value="<?php echo $row["all"]?>" size="31"></td>
</tr>
<tr>
<td valign="top" align="right" nowrap>
Previous illness:</td>
<td valign="top" align="left">
<input type="text" name="ill" value="<?php echo $row["ill"]?>" size="31"></td>
</tr>
<tr>
<td class=topHeadrow1 valign="middle" width="50%" colspan="2">
<b><font size="4">
Heredo-Familial Diseases:</font></b></td>
</tr>
<tr>
<td valign="top" align="right" nowrap>
Maternal:
</td>
<td valign="top" align="left">
<input type="text" name="mat" value="<?php echo $row["mat"]?>" size="20"></td>
</tr>
<tr>
<td valign="top" align="right" nowrap>
Fraternal:
</td>
<td valign="top" align="left">
<input type="text" name="frat" value="<?php echo $row["frat"]?>" size="20"></td>
</tr>
<? }
}
?>
</table>
</center>
</form>
I have a form that submits and send 2 emails: one email to the customer to confirm and the other email to my sales staff.
The email to the customer works just fine, and displays the name and email that are entered in the form in the body of the email
The email to my sales staff lists the information entered on the form. However, when the email is sent to my sales email address the body of the email shows up blank.
HTML:
<form id="RFQ" method="post" action="RFQ-result.php">
<h1 align="center">Request a Quote</h1>
<table width="640" border="0" cellpadding="2" align="center">
<tr>
<td height="32" colspan="6"><strong>PROJECT INFORMATION</strong></td>
</tr>
<tr>
<td width="14"> </td>
<td width="120" align="right">Project Name:</td>
<td colspan="4"><span id="spryProjectName">
<input name="ProjectName" type="text" id="ProjectName" size="50" />
<span class="textfieldRequiredMsg">*</span></span></td>
</tr>
<tr>
<td> </td>
<td align="right"><label for="Company2">Company:</label></td>
<td colspan="4"><span id="spryCompany">
<input name="Company" type="text" id="Company" size="40" />
<span class="textfieldRequiredMsg">*</span></span></td>
</tr>
<tr>
<td> </td>
<td align="right">Address:</td>
<td colspan="4"><span id="spryAddress">
<input name="Address" type="text" id="Address" size="50" />
<span class="textfieldRequiredMsg">*</span></span></td>
</tr>
<tr>
<td> </td>
<td align="right">City: </td>
<td><span id="spryCity">
<input type="text" name="City" id="City" />
<span class="textfieldRequiredMsg">*</span></span></td>
<td width="1"> </td>
<td width="135" align="right">State / Province:</td>
<td width="154"><span id="spryState">
<input type="text" name="State" id="State" />
<span class="textfieldRequiredMsg">*</span></span></td>
</tr>
<tr>
<td> </td>
<td align="right">Postal Code:</td>
<td width="178"><span id="spryZip">
<input name="Zip" type="text" id="Zip" size="10" maxlength="6" />
<span class="textfieldRequiredMsg">*</span></span></td>
<td> </td>
<td align="right">Country: </td>
<td><input type="text" name="Country" id="Country" /></td>
</tr>
<tr>
<td> </td>
<td align="right"> </td>
<td> </td>
<td> </td>
<td align="right"> </td>
<td> </td>
</tr>
</table>
<table width="640" border="0" cellpadding="2" align="center">
<tr>
<td height="32" colspan="6"><strong>CONTACT INFORMATION</strong></td>
</tr>
<tr>
<td width="15"> </td>
<td width="121" align="right">First Name:</td>
<td width="173"><span id="spryFirstName">
<input name="FirstName" type="text" id="FirstName" size="20" />
<span class="textfieldRequiredMsg">*</span></span></td>
<td width="1"> </td>
<td width="89" align="right">Last Name:</td>
<td width="203"><span id="spryLastName">
<input type="text" name="LastName" id="LastName" />
<span class="textfieldRequiredMsg">*</span></span></td>
</tr>
<tr>
<td> </td>
<td align="right">Phone:</td>
<td><span id="spryPhone">
<input name="Phone" type="text" id="Phone" size="20" />
<span class="textfieldRequiredMsg">*</span><span class="textfieldInvalidFormatMsg">Invalid format.</span></span></td>
<td> </td>
<td align="right"><label for="Mobile2">Mobile:</label></td>
<td><span id="spryMobile">
<input name="Mobile" type="text" id="Mobile" size="20" />
<span class="textfieldRequiredMsg">*</span><span class="textfieldInvalidFormatMsg">*Invalid format</span></span></td>
</tr>
<tr>
<td> </td>
<td align="right">E-mail: </td>
<td colspan="4"><span id="spryEmail">
<input name="Email" type="text" id="Email" size="40" />
<span class="textfieldRequiredMsg">*</span><span class="textfieldInvalidFormatMsg">*</span></span></td>
</tr>
<tr>
<td> </td>
<td align="right"> </td>
<td colspan="4"> </td>
</tr>
</table>
<table width="640" border="0" cellpadding="2" align="center">
<tr> </tr>
</table>
<table width="640" border="0" cellpadding="2" align="center">
<tr>
<td height="33" colspan="5"><strong>STANDARD CONFIGURATION</strong></td>
</tr>
<tr>
<td> </td>
<td width="156" colspan="2" align="right">Location of Drive:</td>
<td width="437" colspan="2"><span id="spryDriveCity">
<label for="DriveCity"></label>
<input type="text" name="DriveCity" id="DriveCity" />
<span class="textfieldRequiredMsg">*</span></span>, <span id="spryDriveState">
<label for="DriveState"></label>
<input type="text" name="DriveState" id="DriveState" />
<span class="textfieldRequiredMsg">*</span></span></td>
</tr>
<tr>
<td> </td>
<td colspan="2" align="right">Temperature Range:</td>
<td colspan="2"><span id="spryMinTemp">
<label for="MinTemp"></label>
<input name="MinTemp" type="text" id="MinTemp" size="5" />
- <span class="textfieldRequiredMsg">*</span></span><span id="spryMaxTemp">
<label for="MaxTemp"></label>
<input name="MaxTemp" type="text" id="MaxTemp" size="5" />
<span class="textfieldRequiredMsg">*</span></span> °C</td>
</tr>
<tr>
<td> </td>
<td colspan="2" align="right">Altitude:</td>
<td colspan="2"><span id="spryAltitude">
<label for="Altitude"></label>
<input name="Altitude" type="text" id="Altitude" size="5" />
<span class="textfieldRequiredMsg">*</span><span class="textfieldInvalidFormatMsg">Invalid format</span></span> ft</td>
</tr>
<tr>
<td width="15"> </td>
<td colspan="2" align="right"><label for="PumpType">Type of Application:</label></td>
<td colspan="2"><span id="spryPumpType">
<select name="PumpType" id="PumpType">
<option> </option>
<option value="Beam Pump">Beam Pump</option>
<option value="Progressive Cavity Pump">Progressive Cavity Pump</option>
<option value="Rotaflex Pump">Rotaflex Pump</option>
<option value="Submersible Pump">Submersible Pump</option>
<option value="Surface Centrifugal Compressor">Surface Centrifugal Compressor</option>
<option value="Surface Centrifugal Pump">Surface Centrifugal Pump</option>
<option value="Surface Reciprocating Compressor">Surface Reciprocating Compressor</option>
<option value="Surface Reciprocating Pump">Surface Reciprocating Pump</option>
</select>
<span class="selectRequiredMsg">*</span></span></td>
</tr>
<tr>
<td> </td>
<td colspan="2" align="right">Drive Manufacturer:</td>
<td colspan="2"><span id="spryManufacturer">
<label for="Manufacturer"></label>
<input name="Manufacturer" type="text" id="Manufacturer" size="25" />
<span class="textfieldRequiredMsg">*</span></span></td>
</tr>
<tr>
<td> </td>
<td colspan="2" align="right">Model No:</td>
<td colspan="2"><span id="spryModel">
<label for="Model3"></label>
<input name="Model" type="text" id="Model3" size="20" />
<span class="textfieldRequiredMsg">*</span></span></td>
</tr>
<tr>
<td> </td>
<td colspan="2" align="right">Speed Range:</td>
<td colspan="2"><span id="sprytextfield18">
<label for="MinSpeed"></label>
<input name="MinSpeed" type="text" id="MinSpeed" size="10" />
<span class="textfieldRequiredMsg">*</span></span> - <span id="spryMaxSpeed">
<label for="MaxSpeed"></label>
<input name="MaxSpeed" type="text" id="MaxSpeed" size="10" />
<span class="textfieldRequiredMsg">*</span></span> ft/sec</td>
</tr>
<tr>
<td> </td>
<td colspan="2" align="right">Input Voltage:</td>
<td colspan="2"><span id="spryInputVoltage">
<label for="InputVoltage"></label>
<select name="InputVoltage" id="InputVoltage">
<option> </option>
<option value="200-240 VAC Input">200-240 VAC Input</option>
<option value="380-500 VAC Input">380-500 VAC Input</option>
<option value="525-690 VAC Input">525-690 VAC Input</option>
</select>
<span class="selectRequiredMsg">*</span></span></td>
</tr>
<tr>
<td> </td>
<td colspan="2" align="right">Input Phase:</td>
<td colspan="2"><span id="spryInputPhase">
<select name="InputPhase" id="InputPhase">
<option> </option>
<option value="Single Phase">Single Phase</option>
<option value="Three Phase">Three Phase</option>
</select>
<span class="selectRequiredMsg">*</span></span></td>
</tr>
<tr>
<td> </td>
<td colspan="2" align="right">Frequency:</td>
<td colspan="2"><span id="spryFrequency">
<label for="Frequency"></label>
<input name="Frequency" type="text" id="Frequency" size="10" />
<span class="textfieldRequiredMsg">*</span><span class="textfieldInvalidFormatMsg">Invalid format.</span></span> Hz</td>
</tr>
<tr>
<td> </td>
<td colspan="2" align="right">kW:</td>
<td colspan="2"><span id="sprykW">
<label for="kW"></label>
<input name="kW" type="text" id="kW" size="10" />
<span class="textfieldRequiredMsg">*</span><span class="textfieldInvalidFormatMsg">Invalid format.</span></span></td>
</tr>
<tr>
<td> </td>
<td colspan="2" align="right">HP:</td>
<td colspan="2"><span id="spryHP">
<label for="HP"></label>
<input name="HP" type="text" id="HP" size="5"/>
<span class="textfieldRequiredMsg">*</span><span class="textfieldInvalidFormatMsg">Invalid format.</span></span></td>
</tr>
<tr>
<td> </td>
<td colspan="2" align="right">kVA:</td>
<td colspan="2"><span id="sprykVA">
<label for="kVA"></label>
<input name="kVA" type="text" id="kVA" size="5" width="75"/>
<span class="textfieldRequiredMsg">*</span><span class="textfieldInvalidFormatMsg">Invalid format.</span></span></td>
</tr>
<tr>
<td> </td>
<td colspan="2" align="right">Amps:</td>
<td colspan="2"><span id="spryAmps">
<label for="Amps3"></label>
<input name="Amps" type="text" id="Amps3" size="5" width="75"/>
<span class="textfieldRequiredMsg">*</span><span class="textfieldInvalidFormatMsg">Invalid format.</span> </span></td>
</tr>
<tr>
<td> </td>
<td colspan="2" align="right"> </td>
<td colspan="2"> </td>
</tr>
</table>
<table width="640" border="0" cellpadding="2" align="center">
<tr>
<td height="32" colspan="5" align="left"><strong>OPTIONS</strong></td>
</tr>
<tr>
<td width="14"> </td>
<td colspan="4" align="left">Enclosure & Environment Options:</td>
</tr>
<tr>
<td> </td>
<td align="left"> </td>
<td width="237"><input type="checkbox" name="Shield" id="Shield" />
<label for="Shield">Sun/Snow Sheild</label></td>
<td width="15"> </td>
<td width="327"><input type="checkbox" name="ColdKit" id="ColdKit" />
<label for="ColdKit">Cold Weather Kit (-40 to -50 °C)</label></td>
</tr>
<tr>
<td> </td>
<td align="left"> </td>
<td><input type="checkbox" name="WallStand" id="WallStand" />
<label for="WallStand">Wall Mounting Stand</label></td>
<td> </td>
<td><input type="checkbox" name="HeatKit" id="HeatKit" />
<label for="HeatKit">Heat Trace Kit</label></td>
</tr>
<tr>
<td> </td>
<td align="left"> </td>
<td><input type="checkbox" name="FloorBase" id="FloorBase" />
<label for="FloorBase">Floor Mounting Base</label></td>
<td colspan="2"> </td>
</tr>
<tr>
<td> </td>
<td width="15" align="left"> </td>
<td> </td>
<td colspan="2"> </td>
</tr>
<tr>
<td> </td>
<td colspan="2" align="left">Input:</td>
<td colspan="2">Output:</td>
</tr>
<tr>
<td> </td>
<td align="left"> </td>
<td><input type="checkbox" name="PowerKit" id="PowerKit" />
<label for="PowerKit">Power Terminal Kit.</label></td>
<td> </td>
<td><input type="checkbox" name="MotorKit" id="MotorKit" />
<label for="MotorKit">Motor Terminal Kit</label></td>
</tr>
<tr>
<td> </td>
<td align="left"> </td>
<td><input type="checkbox" name="Harmonic" id="Harmonic" />
<label for="Harmonic">Harmonic Filter Enclosure</label></td>
<td> </td>
<td><input type="checkbox" name="SineFilter" id="SineFilter" />
<label for="SineFilter">Sine Filter Enclosure</label></td>
</tr>
<tr>
<td> </td>
<td colspan="2" align="left"> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td colspan="2" align="left">VFD:</td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td align="left"> </td>
<td colspan="3"><input type="checkbox" name="Fieldbus" id="Fieldbus" />
<label for="Fieldbus">Fieldbus Networks</label></td>
</tr>
<tr>
<td> </td>
<td align="left"> </td>
<td colspan="3"><input type="checkbox" name="ControlKit" id="ControlKit" />
<label for="ControlKit">Control Terminal Kit</label></td>
</tr>
<tr>
<td> </td>
<td align="left"> </td>
<td colspan="3"><input type="checkbox" name="General" id="General" />
<label for="General">General Purpose I/O, 3DI, 2DO, 2AI, 1AO</label></td>
</tr>
<tr>
<td> </td>
<td align="left"> </td>
<td colspan="3"><input type="checkbox" name="Relay" id="Relay" />
<label for="Relay">Relay Option, 3RO, 240Vac, 2A</label></td>
</tr>
<tr>
<td> </td>
<td align="left"> </td>
<td colspan="3"><input type="checkbox" name="DCSupply" id="DCSupply" />
<label for="DCSupply">24 V Ext. DC Supply Connector</label></td>
</tr>
<tr>
<td> </td>
<td align="left"> </td>
<td> </td>
<td colspan="2"> </td>
</tr>
<tr>
<td> </td>
<td colspan="2" align="left">Operation & Support:</td>
<td colspan="2"> </td>
</tr>
<tr>
<td> </td>
<td align="left"> </td>
<td colspan="3"><input type="checkbox" name="iCM" id="iCM" />
<label for="iCM">SALT iCM (remote access internect control module)</label></td>
</tr>
</table>
<blockquote>
<p align="right">
<input name="Submit" type="submit" id="Submit" value="Submit"/>
</p>
</blockquote>
</form>
PHP:
<?php
$ProjectName = $_POST['ProjectName'];
$Company = $_POST['Company'];
$Address = $_POST['Address'];
$City = $_POST['City'];
$State = $_POST['State'];
$Zip = $_POST['Zip'];
$Country = $_POST['Country'];
$FirstName = $_POST['FirstName'];
$LastName = $_POST['LastName'];
$Phone = $_POST['Phone'];
$Mobile = $_POST['Mobile'];
$Email = $_POST['Email'];
$DriveCity = $_POST['DriveCity'];
$DriveState = $_POST['DriveState'];
$MinTemp = $_POST['MinTemp'];
$MaxTemp = $_POST['MaxTemp'];
$Altitude = $_POST['Altitude'];
$PumpType = $_POST['PumpType'];
$Manufacturer = $_POST['Manufacturer'];
$Model = $_POST['Model'];
$MinSpeed = $_POST['MinSpeed'];
$MaxSpeed = $_POST['MaxSpeed'];
$InputVoltage = $_POST['InputVoltage'];
$InputPhase = $_POST['InputPhase'];
$Frequency = $_POST['Frequency'];
$kW = $_POST['kW'];
$HP = $_POST['HP'];
$kVA = $_POST['kVA'];
$Amps = $_POST['Amps'];
$Shield = $_POST['Shield'];
$WallStand = $_POST['WallStand'];
$FloorBase = $_POST['FloorBase'];
$ColdKit = $_POST['ColdKit'];
$HeatKit = $_POST['HeatKit'];
$PowerKit = $_POST['PowerKit'];
$Harmonic = $_POST['Harmonic'];
$MotorKit = $_POST['MotorKit'];
$SineFilter = $_POST['SineFilter'];
$Fieldbus = $_POST['Fieldbus'];
$ControlKit = $_POST['ControlKit'];
$General = $_POST['General'];
$Relay = $_POST['Relay'];
$DCSupply = $_POST['DCSupply'];
$iCM = $_POST['iCM'];
//Sending Email to form owner
$header = "From: $Email\n"
. "Reply-To: $Email\n";
$subject = "SALT RFQ";
$email_to = "sales#pmcsalt.com";
$message = "Project Name: $ProjectName\n" . "Company: $Company\n" . "Address: $Address\n" . "City: $City\n" . "State: $State\n" . "Zip: $Zip\n" . "Country: $Country\n" . "First Name: $FirstName\n" . "Last Name: $LastName\n" . "Phone: $Phone\n" . "Mobile: $Mobile\n" . "Email: $Email\n" .
"Drive City: $DriveCity\n" .
"Drive State: $DriveState\n" .
"Min Temp: $MinTemp\n" .
"Max Temp: $MaxTemp\n" .
"Altitude: $Altitude\n" .
"Application Type: $PumpType\n" .
"Manufacturer: $Manufacturer\n" .
"Model: $Model\n" .
"MinSpeed: $MinSpeed\n" .
"MaxSpeed: $MaxSpeed\n" .
"InputVoltage: $InputVoltage\n" .
"InputPhase: $InputPhase\n" .
"kW: $kW\n" .
"HP: $HP\n" .
"kVA: $kVA\n" .
"Amps: $Amps\n" .
"Sun/Snow Shield: $Shield\n" .
"Wall Mounting Stand: $WallStand\n" .
"Floor Mounting Base: $FloorBase\n" .
"Cold Weather Kit: $ColdKit\n" .
"Heat Trace Kit: $HeatKit\n" .
"Power Terminal Kit: $PowerKit\n" .
"Harmonic Filter Enclosure: $Harmonic\n" .
"Motor Terminal Kit: $MotorKit\n" .
"Sine Filter Enclosure: $SineFilter\n" .
"Fieldbus Networks: $Fieldbus\n" .
"Control Terminal Kit: $ControlKit\n" .
"General Purpose I/O, 3DI, 2DO, 2AI, 1AO: $General\n" .
"Relay Option, 3RO, 240Vac, 2A: $Relay\n" .
"24 V Ext. DC Supply Connector: $DCSupply\n" .
"SALT iCM: $iCM\n" .
mail($email_to, $subject ,$message ,$header ) ;
//Sending Confirmation Email to Client
$header = "From: sales#pmcsalt.com\n"
. "Reply-To: sales#pmcsalt.com\n";
$subject = "SALT RFQ";
$email_to = "$Email";
$message = "Dear $FirstName $LastName,\n \n We have received your pricing request for $ProjectName. One of our sales representatives will be with you within 48 hours to discuss pricing for your custom application.\n \n Thank you for chosing Power Management Controls!! \n \n \n";
mail($email_to, $subject ,$message ,$header ) ;
?>
You're not terminating your concatentation properly:
"24 V Ext. DC Supply Connector: $DCSupply\n" .
"SALT iCM: $iCM\n" .
mail($email_to, $subject ,$message ,$header ) ;
This should be:
24 V Ext. DC Supply Connector: $DCSupply\n" .
"SALT iCM: $iCM\n";
mail($email_to, $subject ,$message ,$header ) ;
At the moment, you've not got anything in $message at the point where you're calling mail().