I am a .NET guy. I am asked to fix a PHP form issue, can you please help me to figure-out db connection issue in the code if any.
I have a page connect.php having following code:-
<?php
$link = mysqli_connect("100.100.10.92","CountryCabs_123","Country!23Cabs_123","newdb1");
if (mysqli_connect_errno()) {
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
?>
Now I've a form with following infomation:-
<?php error_reporting(0); include("connect.php"); ?>
<?php
include('header.php');
?>
<div class="main">
<div style="width:100%;">
<div id="div2">
<div class="head1">Book Your Cab</div>
<div class="content1">
<form name="bookcab" id="bookcab" method="post" >
<table width="100%">
<tr >
<td colspan="4"><div class="titlehead">Local Booking</div></td>
</tr>
<tr>
<td colspan="4"><div><span
style="color:#FF0000">*</span> Mandatory Feilds</div></td>
</tr>
<tr>
<td colspan="4"> <div class="border1"></div></td>
</tr>
<tr>
<td width="15%">CITY</td>
<td width="34%"><select id="size3" name="from3">
<option value="Pune">Pune</option>
</select></td>
<td width="12%" align="right">PACKAGE<span
style="color:#FF0000">*</span></td>
<td width="39%"><select id="size4" name="packages">
<option value="0">Hr/Kms</option>
<?php $select= mysql_query("select * from local_packages");
$i=1;
while($sel= mysql_fetch_assoc($select))
{
?>
<option value="<?php echo
$sel['package_name'];?>"><?php echo $sel['package_name'];?></option>
<?php $i++;}?>
</select></td>
</tr>
<tr>
<td width="15%">Cab Type <span style="color:#FF0000">*</span> :</td>
<td width="39%"><select name="cabtype" id="cabtyp" >
<option value="0">CabType</option>
<option value="Hatchback">HatchBack</option>
<option value="Compact">Compact Sedan</option>
<option value="Sedan">Sedan</option>
<option value="MUV">MUV</option>
</select></td>
</tr>
<tr>
<td colspan="4"> <div class="border1"></div></td>
</tr>
<tr>
<td colspan="4" style="padding-left:5px"><h4>When</h4></td>
</tr>
<tr>
<td style="padding-left:5px">Pickup Date<span
style="color:#FF0000; margin:0px 22px 0px 0px">*</span> : </td>
<td> <span class="k-textbox" style="width:200px"><input
name="datepicker" id="datepicker" class="tcal" value="<?php echo
$_SESSION['date'];?>"/></span></td>
<td width="28%"><span style="padding-left:20px">Pickup Time <span
style="color:#FF0000; margin:0px 35px 0px 0px">*</span> :</td>
<td><input name="timepicker" id="timepicker" value="<?php echo
$_SESSION['time'];?>" style="width:200px"/>
<script>
$(document).ready(function() {
// create TimePicker from input HTML element
$("#timepicker").kendoTimePicker();
});
</script></td>
</tr>
<tr>
<td colspan="4"> <div class="border1"></div></td>
</tr>
<tr>
<td style="padding-left:5px">Pickup Address <span
style="color:#FF0000">*</span> :</td>
<td colspan="3"><select name="pickup" id="pickup"
onchange="selectAdd(this.value)" style="width:200px">
<option value="Home">Home</option>
<option value="Office">Office</option>
<option value="Railway">Railway Station</option>
<option value="Airport">Airport</option>
</select></td>
</tr>
<?php $select= mysql_query("select * from member where
pkey='".$_SESSION['regId']."'");
$selected= mysql_fetch_assoc($select);?>
<tr>
<td > </td>
<td colspan="3"><textarea name="pickupaddress"
class="k-textbox" style="width:300px; height:100px" id="pick"><?php
echo $selected['per_address'];?></textarea></td>
</tr>
<tr>
<td colspan="4"> </td>
</tr>
<tr>
<td colspan="4"><div class="border1"></div></td>
</tr>
<tr>
<td colspan="2" style="padding-left:5px"><h4>Traveller's
Details</h4></td>
<td colspan="2"> </td>
</tr>
<?php $select= mysql_query("select * from member where pkey=
'".$_SESSION['regId']."'");
$list= mysql_fetch_assoc($select); ?>
<tr>
<td colspan="4" ><input type="radio" name="self"
value="self" onclick="addDetails('<?php echo $list['firstname']."
".$list['lastname']?>','<?php echo $list['mobile']; ?>','<?php echo
$list['email'];?>','<?php echo $list['company'];?>')"
checked="checked">
Booking For Self
<input type="radio" name="self" value="other"
onclick="addDetails('','','','')">
Booking For Others</td>
</tr>
<tr>
<td width="18%" style="padding-left:5px">Name
<span style="color:#FF0000 ; margin:0px 52px 0px 0px"> * </span>:</td>
<td><span class="k-textbox" style="width:200px">
<input type="text" name="name" id="name"
value="<?php echo $list['firstname']." ".$list['lastname'];?>" >
</span> </td>
<td width="28%"><span style="margin:0px 0px 0px
20px">Mobile No.<span style="color:#FF0000; margin:0px 47px 0px
0px">*</span> : </span></td>
<td width="38%"><span class="k-textbox" style="width:200px">
<input type="text" name="mobile" id="mobile"
value="<?php echo $list['mobile'];?>" onKeyPress="return
isNumberKey(event)"><script type="text/javascript">function
isNumberKey(evt)
{
var charCode = (evt.which) ? evt.which : event.keyCode;
if (charCode > 31 && (charCode < 48 || charCode > 57))
return false;
return true;
}</script>
</span></td>
</tr>
<tr>
<td width="18%" style="padding-left:5px">Email ID
<span style="color:#FF0000; margin:0px 42px 0px 0px">*</span>: </td>
<td width="18%"><span class="k-textbox" style="width:200px">
<input type="text" name="email" id="email"
value="<?php echo $list['email'];?>">
</span></td>
<td width="28%" ><span style="margin:0px 0px 0px
20px">Company </span><span style="margin:0px 0px 0px
57px">:</span></td>
<td width="38%"><span class="k-textbox" style="width:200px">
<input type="text" name="company" id="company"
value="<?php echo $list['company'];?>">
</span></td>
</tr>
<tr>
<td style="padding-left:5px">Lead<span style="margin:0px
0px 0px 69px">:</span></td>
<td colspan="3"> <select name="lead" id="lead" style="width:200px">
<option value="0">Select</option>
<option value="Website">Website</option>
<option value="Referal">Referal</option>
<option value="Facebook">Facebook</option>
<option value="Twitter">Twitter</option>
<option value="LinkedIn">LinkedIn</option>
<option value="Others">Others</option>
</select> </td>
</tr>
<tr>
<td colspan="4" style="padding-left:5px"><div id="planes"
style="display:none;"> Flight No.: <span class="k-textbox"
style="margin:0px opx 0px 69px">
<input type="text" name="planess" id="planess"
value="" style="width:195px">
</span> </div>
<div id="train" style="display:none;"> Train
No.: <span class="k-textbox"
style="margin-left:50px;width:200px" >
<input type="text" name="trainNo" id="trainNumber"
value="" style="width:195px">
</span> </div></td>
</tr>
<tr>
<td valign="top" style="padding-left:5px">Special
Requirements<span style="margin:0px 0px 0px 18px">:</span></td>
<td colspan="3" >
<textarea class="k-textbox" style="width:300px;
height:100px" id="requ" placeholder="Eg: Clean and Ac Car"></textarea>
</td>
</tr>
<tr>
<td ></td>
<td colspan="3">
<input type="button" name="book" id="book" value=" Book "
onclick="confirm_book_local()" style="float:inherit"
class="btn"></td>
</tr>
</table>
</form>
</div>
</div>
<!--------confim------->
<div style="display:none;" id="div3">
<div class="head1">Booking Details</div>
<div class="content1">
<form name="confirmation" id="confirmation" method="post"
action="submit-form-local.php">
<table width="100%" height="auto" border="0" cellpadding="6"
cellspacing="0" >
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td width="22%"><strong>Traveller's Name</strong></td>
<td width="2%"><strong>:</strong></td>
<td width="72%"> <input type="text" name="dname" id="dname"
style="border:none; background-color:transparent; width:400px;"
readonly/></td>
</tr>
<tr>
<td>
<span style="margin:0px 30px 0px 0px; font-weight:bold">Email
ID</span> </td>
<td><strong>:</strong></td>
<td><span style="font-size:12px; font-weight:bold" ><input
type="text" id="dmail" name="dmail" style="border:none;
background-color:transparent; width:220px;" readonly></span></td>
</tr>
<tr>
<td>
<span style="margin:0px 30px 0px 0px;font-weight:bold">Mobile
No</span> </td>
<td><strong>:</strong></td>
<td><span style="font-size:12px; font-weight:bold" >
<input type="text" id="dmobile" name="dmobile"
style="border:none ;background-color:transparent; width:150px;"
readonly/>
</span></td>
</tr>
<tr>
<td>
<span style="margin:0px 30px 0px 0px;font-weight:bold">Cab
Type</span> </td>
<td><strong>:</strong></td>
<td><span style="font-size:12px; font-weight:bold" >
<input type="text" id="dcabtype" name="dcabtype"
style="border:none ;background-color:transparent; width:150px;"
readonly/>
</span></td>
</tr>
<tr>
<td ><h4>City</h4></td>
<td ><strong>:</strong></td>
<td><input type="text" name="city" value="Pune"
style="border:none;background-color:transparent;" readonly/></td>
</tr>
<tr>
<td><h4>Pickup Address</h4></td>
<td><strong>:</strong></td>
<td ><input type="text" name="dpick" id="dpick"
style="border:none;background-color:transparent;" readonly/></td>
</tr>
<td><h4>Departure Date</h4></td>
<td><strong>:</strong></td>
<td ><input type="text" name="Pdate" id="Pdate"
style="border:none;background-color:transparent;" readonly/></td>
</tr>
<td><h4>Departure Time</h4></td>
<td><strong>:</strong></td>
<td ><input type="text" name="Ptime" id="Ptime"
style="border:none;background-color:transparent;" readonly/></td>
</tr>
<tr>
<td><h4>Special Requirements</h4></td>
<td><strong>:</strong></td>
<td><input type="text" id="special" name="special"
style="border:none;background-color:transparent;" readonly/></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td ><input type="checkbox" name="accept" id="accept">
I have Read And Accept The <a href="termsconditions.php"
target="_blank">Terms And Conditions</a></td>
</tr>
<tr>
<td></td>
<td></td>
<td><input type="radio" name="pay" value="cos"
onchange="display_message(1)" checked="checked">
<strong>Cash On Service</strong>
<input type="radio" name="pay" value="pay_now"
onchange="display_message(2)">
<strong> Pay Online</strong></td>
</tr>
<tr>
<td></td>
<td></td>
<td id="m1" style="display:none; color:#FF0000">Extremely Sorry!
Online payment mode is temporarily down, please select cash on
service as of now. We regret for the inconvenience you had.</td>
</tr>
<tr>
<td></td>
<td></td>
<td>
<input type="submit" name="confirm" id="con1"
value="Confirm" style="float:left;margin-right:20px;" class="btn"
onclick="validCondition()">
<input type="button" name="back" value="Back" style="float:left;"
class="btn" onclick="bookback()"> </td>
</tr>
<tr>
<td></td>
<td></td>
<td style="margin-left:20px">You can cancel your booking
anytime. Please read our <a href="cancellation_ privacy.php"
target="_blank">cancellation policy</a> for more details.</td>
</tr>
<tr><td><input type="hidden" name="hiddencarId" value="<?php echo
$_GET['id'];?>"></td>
<td> </td>
</tr>
</table>
</div>
</div>
</div>
<div class="clear"></div>
<?php include('footer.php');?>
<script>
document.getElementById('li05').classList.add('active');
</script>
There is some user accessibility issue on database, we are using GoDaddy. I verified the credentials on MySQL Workbench i can connect database. Can you please verify if any issue in code.
You're mixing mysqli with mysql. Should be using mysqli only instead of mysql, which is already deprecated. And when using mysqli, it is best (and a must) to be doing prepared statement on it to prevent SQL injections.
I'll be doing the first drop down for an example, so you can have an idea and do the rest.
<select id="size4" name="packages">
<option value="0">Hr/Kms</option>
<?php
$select= "SELECT package_name FROM local_packages";
if($stmt=$link->prepare($select)){
$stmt->execute();
$stmt->bind_result($packagename); /* BIND THE RESULT */
$i=1;
while($stmt->fetch()){ /* FETCH RESULTS */
printf("<option value='%s'>%s</option>",$packagename,$packagename);
$i++;
} /* END OF WHILE LOOP */
$stmt->close();
}
?>
</select>
I still included the $i variable. Maybe you have other purpose for it.
I am trying to populate data from a click-able div container to a text box.
All the below code is present in same file "schedule.php".
The jQuery function is:
$(document).ready(function(){
$("#listItem1").click(function(){
var selectedAddress = $("#listItem1").attr("value");
$.post("schedule.php",selectedAddress,function(selectedAddress){
addressSelect($("#listItem1").attr("value"));
});
});
});
The php code is present in the same file:
<?php
function addressSelect($selectedAddress) {
$selectedAddress=$_POST['$selectedAddress'];
//echo $selectedAddress;
if(isset($selectedAddress)) list($fromName, $fromAddress, $fromCity, $fromState, $fCountry, $fromZip, $fromPhone) = explode("$$$", $selectedAddress);
}
?>
I am not able to populate it. I tried to using $.ajax also... but not helping.. what should I do to populate the textboxes at all.
The HTML is like this:
<table CELLSPACING=0 CELLPADDING=1 border=0 width=200>
<tr><td colspan=4 height=10></td></tr>
<tr>
<td width=7></td>
<td WIDTH=180 height=35><b>Name</b><font size="-1" color="#FF0000">*</font></td>
<td colspan=2 WIDTH=220>
<input NAME="fromName" TYPE="text" id="fromName" placeholder="Sender's Name" style="width:150px;" value="<?php echo $fromName;?>" MAXLENGTH="35" autofocus onBlur="ValidateName(fromName)">
<span class="error"> <?php echo $fromNameErr;?></span>
</td>
</tr>
<tr>
<td></td>
<td height=35><b>Address</b><font size="-1" color="#FF0000">*</font></td>
<td>
<TEXTAREA NAME="fromAddress" COLS=30 ROWS=3 id="fromAddress" placeholder="Sender's Address" style="width:200px; height:130px; font-size:13px; font-family:Arial,sans-serif" onBlur="ValidateAddress(fromAddress)"></TEXTAREA>
<span class="error"> <?php echo $fromAddressErr;?></span>
</td>
<td rowspan=3 align="center"></td>
</tr>
<tr>
<td></td>
<td height=35><b>Landmark</td>
<td>
<input NAME="fromLandmark" TYPE="text" id="fromLandmark" placeholder="optional" style="width:150px" value="<?php echo $fromLandmark;?>" MAXLENGTH=45>
</td>
</tr>
<tr>
<td></td>
<td height=35><b>City</b><font size="-1" color="#FF0000">*</font></td>
<td>
<input NAME="fromCity" TYPE="text" id="fromCity" placeholder="Source City" style="width:150px" value="<?php echo $fromCity;?>" MAXLENGTH=35>
</td>
</tr>
<tr>
<td></td>
<td height=35><b>State</b><font size="-1" color="#FF0000">*</font></td>
<td colspan=2>
<input NAME="fromState" TYPE="text" id="fromState" placeholder="State of Source City" style="width:150px" value="<?php echo $fromState;?>" MAXLENGTH=25>
</td>
</tr>
<tr>
<td></td>
<td height=35><b>Zip</b><font size="-1" color="#FF0000">*</font></td>
<td colspan=2>
<input NAME="fromZip" TYPE="text" id="fromZip" placeholder="Pin Code" style="width:90px" value="<?php echo $fromZip;?>" MAXLENGTH=15 onBlur="ValidateZip(fromZip)">
<span class="error"> <?php echo $fromZipErr;?></span>
</td>
</tr>
<tr>
<td></td>
<td height=35><b>Country</b></td>
<td colspan=2>
<select NAME="fromCountry" id="fromCountry" disabled="disabled">
<?php populate_country();?>
</select></div></td>
</td>
</tr>
<tr>
<td></td>
<td height=35><b>Phone</b><font size="-1" color="#FF0000">*</font></td>
<td colspan=2>
<input NAME="fromPhone" TYPE="text" id="fromPhone" placeholder="Sender's Phone no." style="width:150px" value="<?php echo $fromPhone;?>" MAXLENGTH=15 onBlur="ValidatePhone(fromPhone)">
<span class="error"> <?php echo $fromPhoneErr;?></span>
</td>
</tr>
<tr><td colspan=4 height=10></td></tr>
</table>
<?php /*?><td style="border-right:1px solid #b2b2b2; font-size:1px; background-color: #fafafa"> </td><?php */?>
</tr>
<tr>
<td width=6 height=6></td>
<?php /*?><td height=6 style="border-bottom:1px solid #b2b2b2; font-size:1px; background-color: #fafafa"> </td><?php */?>
<td width=6 height=6></td>
</tr>
</table><!-- End of From Address container table-->
The code provided by #user2298875 has a little mistake. Change
content = $("#" + divId).innerHTML;
$("#" + textBoxId).value = content;
to
$("#" + textBoxId).val($("#" + divId).html());
I think you want to copy the data on the browser and not on the server. You can use the following JQuery code to get it done:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js">
</script>
<script language="javascript" type="text/javascript">
function copyData(divId, textBoxId) {
content = $("#" + divId).html();
$("#" + textBoxId).val(content);
}
</script>
<body>
<div id="my-div" onclick="copyData('my-div', 'my-text-box');">
This the data to be copied.
</div>
<input type="text" id="my-text-box" name="myTextBox"/>
</body>
I'm having a hard time figuring this out. Tried everything, yet nothing seems to work. I even have two similar pages and the other inserts and updates just fine but this has been giving me sleepless nights.
After filling form entries and submitting, there's a confirmation that the record has been added but nothing is inserted into the database table. This is supposed to be part of an app for a clinic to deal with maternity/anc/pnc but this problem affects only the anc files. The pnc part of it works pretty well.
I'm certain you guys can help me see exactly what I'm not doing right and I truly would appreciate any assistance. Right or wrong.
First here's the file that's supposed to insert the records, called submitanc.php:
#$cid= $_POST["cid"];
#$card= $_POST["card"];
#$date= $_POST["date"];
#$doctor= $_POST["doctor"];
#$riskfactor= $_POST["riskfactor"];
#$cycle= $_POST["cycle"];
#$lmp= $_POST["lmp"];
#$edd= $_POST["edd"];
#$gestationage= $_POST["gestationage"];
#$visit= $_POST["visit"];
#$parity= $_POST["parity"];
#$bp= $_POST["bp"];
#$height= $_POST["height"];
#$weight= $_POST["weight"];
#$gestation= $_POST["gestation"];
#$fhh= $_POST["fhh"];
#$sickling= $_POST["sickling"];
#$hb= $_POST["hb"];
#$hb36wk= $_POST["hb36wk"];
#$vdll= $_POST["vdll"];
#$pmtct= $_POST["pmtct"];
#$arv= $_POST["arv"];
#$tt= $_POST["tt"];
#$itw= $_POST["itw"];
#$ipt= $_POST["ipt"];
#$referredto= $_POST["referredto"];
#$diagnosis= $_POST["diagnosis"];
#$remark= $_POST["remark"];
require_once 'conn.php';
if (isset($_POST['submit']))
{
switch ($_POST['submit'])
{
case 'Add Record':
if (Trim($card) != "" and Trim($date) != "")
{
$query_insert = "Insert into `anc` (`Card Number`, `Date`, `Physician`, `Risk Factor`, `Cycle`, `LMP`, `Edd`, `Gestation Age`, `Visit`, `Parity`, `BP`, `Height`, `Weight`, `Gestation`, `FHH`, `Sickling`, `HB#Reg`, `Temp`, `VDLL`, `PMTCT`, `ARV`,`TT`,`IPT`,`ITW`,`Referred To`,`Diagnosis` `Remark`,`SFH`,`HIV`,`Hep B`,`PH`,`Urine`,`Presentation`,`Lie`)
VALUES ('$card', '$date', '$doctor', '$riskfactor', '$cycle', '$lmp', '$edd', '$gestationage', '$visit', '$parity', '$bp', '$height', '$weight', '$gestation', '$fhh', '$sickling', '$hb', '$temp', '$vdll', '$pmtct', '$arv','$tt','$ipt','$itw','$referredto','$diagnosis', '$remark','$sfh','$hiv','$hepb','$ph','$urine','$presentation','$lie')"; $result_insert = mysql_query($query_insert);
And here, I know its crazy, but this is the form page, called anc.php:
<form action="submitanc.php" method="post">
<fieldset id="fieldset">
<legend><b><font size="2" face="Tahoma" color="green">Ante-Natal Basics</font></b></legend>
<div align="left">
<TABLE width='99%' border='0' cellpadding='1' cellspacing='1' align='center' bordercolor="#005B00" id="">
<tr>
<td width="20%">
<b><font face="Verdana" style="font-size: 9pt">Date of Visit:</font></b>
</td>
<td>
<input type="hidden" size="20" name="card" value="<?php echo $card; ?>">
<input type="hidden" size="20" name="cid" value="<?php echo $idx; ?>">
<?php
if (!$idx)
{ ?>
<input id="inputField" type="text" size="20" name="date" value="<?php echo date('Y-m-d'); ?>">
<?php
} else
{ ?>
<input id="inputField" type="text" size="20" name="date" value="<?php echo $srow['Date']; ?>">
<?php } ?>
</td>
<td width="20%">
<b><font face="Verdana" style="font-size: 9pt">Name of Doctor/Midwife:</font></b>
</td>
<td>
<input type="text" size="20" name="doctor" value="<?php echo $srow['Physician']; ?>">
</td>
</tr>
<tr>
<td width="10%">
<b><font face="Verdana" style="font-size: 9pt">Major Risk Factor:</font></b>
</td>
<td colspan='3'>
<textarea cols="40" rows="3" name="riskfactor"><?php echo $srow['Risk Factor']; ?></textarea>
</td>
</tr>
</table>
</fieldset>
<fieldset id="fieldset">
<legend><b><font size="2" face="Tahoma" color="green">Menstrual History</font></b></legend>
<div align="left">
<TABLE width='99%' border='0' cellpadding='1' cellspacing='1' align='center' bordercolor="#005B00" id="">
<tr>
<td width="20%">
<b><font face="Verdana" style="font-size: 9pt">Cycle:</font></b>
</td>
<td>
<input type="text" size="20" name="cycle" value="<?php echo $srow['Cycle']; ?>">
</td>
<td width="20%">
<b><font face="Verdana" style="font-size: 9pt">Last Mentrual Period (L.M.P):</font></b>
</td>
<td>
<input type="text" size="20" name="lmp" value="<?php echo $srow['LMP']; ?>">
</td>
</tr>
<tr>
<td width="10%">
<b><font face="Verdana" style="font-size: 9pt">Expected Delivery Date (E.D.D):</font></b>
</td>
<td>
<input type="text" size="20" name="edd" value="<?php echo $srow['EDD']; ?>">
</td>
<td width="10%">
<b><font face="Verdana" style="font-size: 9pt">Gestation Age at Booking:</font></b>
</td>
<td>
<input type="text" size="20" name="gestationage" value="<?php echo $srow['Gestation Age']; ?>">
</td>
</tr>
</TABLE>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#dcdfdf" width="100%" id="AutoNumber1">
<?php
echo "<TR bgcolor='#9ff4ae'><TH><b><u>LMP </b></u> </TH><TH><b><u>EDD </b></u> </TH><TH><b><u>EGA to Date</b></u> </TH></TR>";
$querya="SELECT `ID`,`Card Number`,`Date`,`LMP`,`EDD`,`Gestation Age` FROM `anc` WHERE `Card Number`='$card' order by `Date` desc";
$resulta=mysql_query($querya);
while(list($idx,$cart,$date,$lmp,$edd,$ega)=mysql_fetch_row($resulta))
{
echo "<TR><TH><a title='Click on this to amend it' href = 'anc.php?idx=" . $idx . "&card=" . $cart . "&dat=" . $date . "'>$lmp </a> </TH><TH> $edd </TH><TH>$ega </font></TH></TR>";
}
?>
</table>
</fieldset>
<fieldset id="fieldset">
<legend><b><font size="2" face="Tahoma" color="green">Ante-Natal Examination</font></b></legend>
<div align="left">
<TABLE width='99%' border='0' cellpadding='1' cellspacing='1' align='center' bordercolor="#005B00" id="">
<tr>
<td width="10%">
<b><font face="Verdana" style="font-size: 9pt">Blood Pressure:</font></b>
</td>
<td>
<input type="text" size="20" name="bp" value="<?php echo $srow['BP']; ?>">
</td>
<td width="10%">
<b><font face="Verdana" style="font-size: 9pt">Parity:</font></b>
</td>
<td>
<input type="text" size="20" name="parity" value="<?php echo $srow['Parity']; ?>">
</td>
</tr>
<tr>
<td width="10%">
<b><font face="Verdana" style="font-size: 9pt">Weight:</font></b>
</td>
<td>
<input type="text" size="20" name="weight" value="<?php echo $srow['Weight']; ?>">
</td>
<td width="10%">
<b><font face="Verdana" style="font-size: 9pt">Temperature:</font></b>
</td>
<td>
<input type="text" size="20" name="temp" value="<?php echo $srow['Temp']; ?>">
</td>
</tr>
<tr>
<td width="10%">
<b><font face="Verdana" style="font-size: 9pt">Visit:</font></b>
</td>
<td>
<select size="1" name="visit">
<?php
echo '<option selected>' . $srow['Visit'] . '</option>';
echo '<option>New Visit</option>';
echo '<option>Returning Visit</option>';
?>
</select>
</td>
<td width="10%">
<b><font face="Verdana" style="font-size: 9pt">Height:</font></b>
</td>
<td>
<input type="text" size="20" name="height" value="<?php echo $srow['Height']; ?>">
</td>
</tr>
<tr>
<td width="10%">
<b><font face="Verdana" style="font-size: 9pt">Gestational Age:</font></b>
</td>
<td>
<input type="text" size="20" name="gestation" value="<?php echo $srow['Gestation']; ?>">
</td>
<td width="10%">
<b><font face="Verdana" style="font-size: 9pt">SFH:</font></b>
</td>
<td>
<input type="text" size="20" name="sfh" value="<?php echo $srow['SFH']; ?>">
</td>
</tr>
<tr>
<td width="10%">
<b><font face="Verdana" style="font-size: 9pt">Sickling:</font></b>
</td>
<td>
<input type="text" size="20" name="sickling" value="<?php echo $srow['Sickling']; ?>">
</td>
<td width="10%">
<b><font face="Verdana" style="font-size: 9pt">Hb:</font></b>
</td>
<td>
<input type="text" size="20" name="hb" value="<?php echo $srow['HB#Reg']; ?>">
</td>
</tr>
<tr>
<td width="10%">
<b><font face="Verdana" style="font-size: 9pt">HIV:</font></b>
</td>
<td>
<input type="text" size="20" name="hiv" value="<?php echo $srow['HIV']; ?>">
</td>
<td width="10%">
<b><font face="Verdana" style="font-size: 9pt">Hep B:</font></b>
</td>
<td>
<input type="text" size="20" name="hepb" value="<?php echo $srow['HepB']; ?>">
</td>
</tr>
<tr>
<td width="10%">
<b><font face="Verdana" style="font-size: 9pt">PH:</font></b>
</td>
<td>
<input type="text" size="20" name="ph" value="<?php echo $srow['PH']; ?>">
</td>
<td width="10%">
<b><font face="Verdana" style="font-size: 9pt">Urine:</font></b>
</td>
<td>
<input type="text" size="20" name="urine" value="<?php echo $srow['Urine']; ?>">
</td>
</tr>
<tr>
<td width="10%">
<b><font face="Verdana" style="font-size: 9pt">Presentation:</font></b>
</td>
<td>
<input type="text" size="20" name="presentation" value="<?php echo $srow['Presentation']; ?>">
</td>
<td width="10%">
<b><font face="Verdana" style="font-size: 9pt">Lie:</font></b>
</td>
<td>
<input type="text" size="20" name="lie" value="<?php echo $srow['Lie']; ?>">
</td>
</tr>
<tr>
<td width="10%">
<b><font face="Verdana" style="font-size: 9pt">FHR:</font></b>
</td>
<td>
<input type="text" size="20" name="fhh" value="<?php echo $srow['FHH']; ?>">
</td>
<td width="10%">
<b><font face="Verdana" style="font-size: 9pt">Sickling:</font></b>
</td>
<td>
<input type="text" size="20" name="sickling" value="<?php echo $srow['Sickling']; ?>">
</td>
</tr>
<tr>
<td width="10%">
<b><font face="Verdana" style="font-size: 9pt">VDLL:</font></b>
</td>
<td>
<input type="text" size="20" name="vdll" value="<?php echo $srow['VDLL']; ?>">
</td>
<td width="10%">
<b><font face="Verdana" style="font-size: 9pt">PMTCT:</font></b>
</td>
<td>
<?php
$sqlv2 = "SELECT `val`,`type` FROM `booln` ORDER BY `type` desc";
$result_v2 = mysql_query($sqlv2,$conn) or die('Could not list; ' . mysql_error());
$v2=$srow['PMTCT'];
while ($rows = mysql_fetch_array($result_v2))
{
echo ' <input type="radio" class="radio" align="left" id="v2_' . $rows['val'] . '" name="pmtct" value="' . $rows['val'] . '" ';
if ($rows['val'] == $v2)
{
echo 'checked="checked" ';
}
echo '/>' . $rows['type'] . "\n";
}
?>
</td>
</tr>
<tr>
<td width="10%">
<b><font face="Verdana" style="font-size: 9pt">ARV:</font></b>
</td>
<td>
<input type="text" size="20" name="arv" value="<?php echo $srow['ARV']; ?>">
</td>
<td width="10%">
<b><font face="Verdana" style="font-size: 9pt">TT:</font></b>
</td>
<td>
<input type="text" size="20" name="tt" value="<?php echo $srow['TT']; ?>">
</td>
</tr>
<tr>
<td width="10%">
<b><font face="Verdana" style="font-size: 9pt">ITW:</font></b>
</td>
<td>
<input type="text" size="20" name="itw" value="<?php echo $srow['ITW']; ?>">
</td>
<td width="10%">
<b><font face="Verdana" style="font-size: 9pt">IPT:</font></b>
</td>
<td>
<?php
$sqlv2 = "SELECT `val`,`type` FROM `booln` ORDER BY `type` desc";
$result_v2 = mysql_query($sqlv2,$conn) or die('Could not list; ' . mysql_error());
$v2=$srow['IPT'];
while ($rows = mysql_fetch_array($result_v2))
{
echo ' <input type="radio" class="radio" align="left" id="v2_' . $rows['val'] . '" name="ipt" value="' . $rows['val'] . '" ';
if ($rows['val'] == $v2)
{
echo 'checked="checked" ';
}
echo '/>' . $rows['type'] . "\n";
}
?>
</td>
</tr>
<tr>
<td width="15%">
<b><font face="Verdana" style="font-size: 9pt">Refered To:</font></b>
</td>
<td>
<input type="text" size="20" name="referredto" value="<?php echo $srow['Referred To']; ?>">
</td>
<td width="15%">
<b><font face="Verdana" style="font-size: 9pt">Diagnosis:</font></b>
</td>
<td>
<input type="text" size="20" name="diagnosis" value="<?php echo $srow['Diagnosis']; ?>">
</td>
</tr>
<tr>
<td width="14%">
<b><font face="Verdana" style="font-size: 9pt">Remark:</font></b>
</td>
<td colspan='3'>
<textarea cols="40" rows="3" name="remark"><?php echo $srow['Remark']; ?></textarea>
</td>
</tr>
<tr>
<td width="10%">
<?php
if (!$idx)
{ ?>
<input type="submit" value="Add Record" name="submit">
<?php
} else
{ ?>
<input type="submit" value="Update Record" name="submit">
<?php } ?>
</td>
</tr>
</TABLE>
</form>
</fieldset>
<fieldset style="padding: 2">
<legend><b><font size="2" face="Tahoma" color="green">History of ANC</font></b></legend>
<b><font color="#FF0000" style="font-size: 8pt"><?php echo $tval ; ?></font></b>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#dcdfdf" width="99%" id="AutoNumber1">
<?php
echo "<TR bgcolor='#9ff4ae'><TH><b><u>Date of Visit </b></u> </TH><TH><b><u>Weight </b></u> </TH><TH><b><u>BP</b></u> </TH><TH><b><u>SFH </b></u> </TH><TH><b><u>Urine </b></u> </TH><TH><b><u>FHR </b></u> </TH></TR>";
$query="SELECT `ID`,`Card Number`,`Date`,`Weight`,`BP`,`SFH`,`Urine`,`FHR` FROM `anc` WHERE `Card Number`='$card' order by `Date` desc";
$result=mysql_query($query);
while(list($idx,$cart,$date,$wt,$bp,$sfh,$urine,$fhr)=mysql_fetch_row($result))
{
echo "<TR><TH><a title='Click on this to amend it' href = 'anc.php?idx=" . $idx . "&card=" . $cart . "&dat=" . $date . "'>$date </a> </TH><TH> $wt </TH><TH>$bp </font></TH><TH>$sfh </TH><TH>$urine </TH><TH>$fhr </TH></TR>";
}
?>
</table>
</fieldset>
its better to use
mysql_escape_string($_POST['fieldname']);
and echo that query and check in mysql
$query_insert = "Insert into `anc` (`Card Number`, `Date`, `Physician`, `Risk Factor`, `Cycle`, `LMP`, `Edd`, `Gestation Age`, `Visit`, `Parity`, `BP`, `Height`, `Weight`, `Gestation`, `FHH`, `Sickling`, `HB#Reg`, `Temp`, `VDLL`, `PMTCT`, `ARV`,`TT`,`IPT`,`ITW`,`Referred To`,`Diagnosis` `Remark`,`SFH`,`HIV`,`Hep B`,`PH`,`Urine`,`Presentation`,`Lie`)
VALUES ('$card', '$date', '$doctor', '$riskfactor', '$cycle', '$lmp', '$edd', '$gestationage', '$visit', '$parity', '$bp', '$height', '$weight', '$gestation', '$fhh', '$sickling', '$hb', '$temp', '$vdll', '$pmtct', '$arv','$tt','$ipt','$itw','$referredto','$diagnosis', '$remark','$sfh','$hiv','$hepb','$ph','$urine','$presentation','$lie')"; $result_insert = mysql_query($query_insert);
$res=mysql_query($query_insert);
if(!$res){
die('Could not enter data: ' . mysql_error());
}
//Confirm success with the username
echo '<p><b>Your MSG</b></p>';
}
then give the successfull msg . and figure where its goin wrong
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().