I have these codes, used to update mysql database
AIS.php-used to input pnum and then new.php will show the corresponding record for the pnum
<style>
input { font-size: 16px;}
</style>
<?php include('header.php'); ?>
<div id="main_content">
</div>
<?php include('footer.php'); ?>
<table width="900" border="0" align="left" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
<tr>
<form name="form1" method="post" action="new.php">
<td>
<table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF">
<tr>
<td colspan="16" style="background:#9ACD32; color:white; border:white 1px solid; text-align: center"><strong><font size="3">UPDATE IN-PATIENT</strong></td>
</tr>
<tr>
<td width="54"><font size="3">Patient #</td>
<td width="3">:</td>
<td width="168"><input name="pnum" type="text" id="pnum" maxlength="4"></td>
</tr>
<td width="54"><font size="3">Hospital #</td>
<td width="3">:</td>
<td width="168"><input name="hnum" type="text" id="hospnum" maxlength="4"></td>
<td width="41"><font size="3">Room #</td>
<td width="3">:</td>
<td width="168"><input name="rnum" type="text" id="rnum" maxlength="4"></td>
<td width="67"><font size="3">Date</td>
<td width="3">:</td>
<td width="168"><input name="adate" type="text" id="adate" maxlength="15">
<td width="67"><font size="3">Time</td>
<td width="3">:</td>
<td width="168"><input name="adtime" type="text" id="adtime" maxlength="15">
</td>
</tr>
<tr>
<td><font size="3">Last Name</td>
<td>:</td>
<td><input name="lname" type="text" id="lname" maxlength="15"></td>
<td><font size="3">First Name</td>
<td>:</td>
<td><input name="fname" type="text" id="fname" maxlength="15"></td>
<td><font size="3">Middle Name</td>
<td>:</td>
<td><input name="mname" type="text" id="mname" maxlength="15"></td>
</tr>
<tr>
<td><font size="3">Civil Status</td>
<td>:</td>
<td><input name="cs" type="text" id="cs" maxlength="7"></td>
<td><font size="3">Age</td>
<td>:</td>
<td><input name="age" type="text" id="age" maxlength="3"></td>
<td><font size="3">Birthday</td>
<td>:</td>
<td><input name="bday" type="text" id="bday" maxlength="11"></td>
</tr>
<tr>
<td><font size="3">Address</td>
<td>:</td>
<td><input name="ad" type="text" id="ad" maxlength="25"></td>
<td><font size="3">Telephone #</td>
<td>:</td>
<td><input name="telnum" type="text" id="telnum" maxlength="11"></td>
<td width="23"><font size="3">Sex</td>
<td width="3">:</td>
<td width="174"><input name="sex" type="text" id="sex" maxlength="1"></td>
</tr>
<tr>
<td><font size="3">Pls. Check</td>
<td>:</td>
<input type='hidden' name="stats1" value="0">
<td><input name="stats1" type="checkbox" id="SSS" value="SSS">SSS</td>
<td><font size="3"></td>
<td>:</td>
<input type='hidden' name="stats2" value="0">
<td><input name="stats2" type="checkbox" id="nonmed" value="NonMedicare">Non Medicare</td>
<td><font size="3"></td>
<td>:</td>
<input type='hidden' name="stats3" value="0">
<td><input name="stats3" type="checkbox" id="sh" value="stockholder">Stockholder</td>
</tr>
<tr>
<td><font size="3"></td>
<td></td>
<input type='hidden' name="stats4" value="0">
<td><input name="stats4" type="checkbox" id="gsis" value="GSIS">GSIS</td>
<td><font size="3"></td>
<td></td>
<input type='hidden' name="stats5" value="0">
<td><input name="stats5" type="checkbox" id="senior" value="seniorcitizen">Senior-Citizen</td>
<tr>
<td><font size="3"></td>
<td></td>
<input type='hidden' name="stats6" value="0">
<td><input name="stats6" type="checkbox" id="dep" value="dependent">Dependent</td>
<td><font size="3"></td>
<td></td>
<input type='hidden' name="stats7" value="0">
<td><input name="stats7" type="checkbox" id="emp" value="employee">Employee</td>
<td><font size="3"></td>
<td></td>
<input type='hidden' name="stats8" value="0">
<td><input name="stats8" type="text" id="" value="" maxlength="15">Others</td>
</tr>
<tr>
<td><font size="3">Admitting/Attending Nurse</td>
<td>:</td>
<td><input name="nurse" type="text" id="nurse" maxlength="15"></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td><input type="submit" name="Submit" value="Search"></td>
</form>
</tr>
</table>
</td>
</form>
</tr>
</table>
<table>
<tr><td>
</tr>
</table>
</html>
new.php
<html>
<head>
<style>
input { font-size: 16px;}
</style>
<?php include('header.php'); ?>
<div id="main_content">
</div>
<?php include('footer.php'); ?>
<?php
$con = mysql_connect("localhost","","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("Hospital", $con);
$result = mysql_query("SELECT * FROM t2 WHERE PNUM='{$_POST["pnum"]}'");
?>
<table width="900" border="0" align="left" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
<td>
<table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF">
<tr>
<td colspan="16" style="background:#9ACD32; color:white; border:white 1px solid; text-align: center"><strong><font size="3">UPDATE IN-PATIENT INFORMATION SHEET</strong></td>
</tr>
<tr>
<?php while ( $row = mysql_fetch_array($result) ) { ?>
<form name="form1" method="post" action="update.php">
<input type='hidden' name="pnum" value="">
<td width="54"><font size="3">Hospital #</td>
<td width="3">:</td>
<td width="168"><input name="hnum" type="text" maxlength="4" value="<?php echo $row["HOSPNUM"]; ?> ">
</td>
<td width="41"><font size="3">Room #</td>
<td width="3">:</td>
<td width="168"><input name="rnum" type="text" maxlength="4" value="<?php echo $row["ROOMNUM"]; ?>">
</td>
<td width="67"><font size="3">Admission Date</td>
<td width="3">:</td>
<td width="168"><input name="adate" type="text" maxlength="15" value="<?php echo $row["ADATE"]; ?>">
</td>
<td width="67"><font size="3">Admission Time</td>
<td width="3">:</td>
<td width="168"><input name="adtime" type="text" maxlength="15" value="<?php echo $row["ADTIME"]; ?>">
</td>
</tr>
<tr>
<td><font size="3">Last Name</td>
<td>:</td>
<td><input name="lname" type="text" maxlength="15" value="<?php echo $row["LASTNAME"]; ?>"></td>
<td><font size="3">First Name</td>
<td>:</td>
<td><input name="fname" type="text" maxlength="15" value="<?php echo $row["FIRSTNAME"]; ?>"></td>
<td><font size="3">Middle Name</td>
<td>:</td>
<td><input name="mname" type="text" maxlength="15" value="<?php echo $row["MIDNAME"]; ?>"></td>
</tr>
<tr>
<td><font size="3">Civil Status</td>
<td>:</td>
<td><input name="cs" type="text" maxlength="7" value="<?php echo $row["CSTAT"]; ?>"></td>
<td><font size="3">Age</td>
<td>:</td>
<td><input name="age" type="text" maxlength="3" value="<?php echo $row["AGE"]; ?>"></td>
<td><font size="3">Birthday</td>
<td>:</td>
<td><input name="bday" type="text" maxlength="7"value="<?php echo $row["BDAY"]; ?>"></td>
</tr>
<tr>
<td><font size="3">Address</td>
<td>:</td>
<td><input name="ad" type="text" maxlength="25" value="<?php echo $row["ADDRESS"]; ?>"></td>
<td><font size="3">Telephone #</td>
<td>:</td>
<td><input name="telnum" type="text" maxlength="11" value="<?php echo $row["TELNUM"]; ?>"></td>
<td width="23"><font size="3">Sex</td>
<td width="3">:</td>
<td width="174"><input name="sex" type="text" maxlength="1" value="<?php echo $row["SEX"]; ?>"></td>
</tr>
<tr>
<td><font size="3">Pls. Check</td>
<td>:</td>
<input type='hidden' name="stats1" value="0">
<td><input name="stats1" type="checkbox" id="SSS" maxlength="3" value="SSS">SSS</td>
<td><font size="3"></td>
<td>:</td>
<input type='hidden' name="stats2" value="0">
<td><input name="stats2" type="checkbox" id="nonmed" maxlength="9" value="Non Med">Non Medicare</td>
<td><font size="3"></td>
<td>:</td>
<input type='hidden' name="stats3" value="0">
<td><input name="stats3" type="checkbox" id="sh" value="stockholder">Stockholder</td>
</tr>
<tr>
<td><font size="3"></td>
<td></td>
<input type='hidden' name="stats4" value="0">
<td><input name="stats4" type="checkbox" id="gsis" value="gsis">GSIS</td>
<td><font size="3"></td>
<td></td>
<input type='hidden' name="stats5" value="0">
<td><input name="stats5" type="checkbox" id="senior" value="senior citizen">Senior-Citizen</td>
<tr>
<td><font size="3"></td>
<td></td>
<input type='hidden' name="stats6" value="0">
<td><input name="stats6" type="checkbox" id="dep" value="Dependent">Dependent</td>
<td><font size="3"></td>
<td></td>
<input type='hidden' name="stats7" value="0">
<td><input name="stats7" type="checkbox" id="emp" value="Employee">Employee</td>
<td><font size="3"></td>
<td></td>
<input type='hidden' name="stats8" value="0">
<td><input name="stats8" type="text" id="" maxlength="15" value="<?php echo $row["STAT8"]; ?>" >Others</td>
</tr>
<tr>
<td><font size="3">Admitting/Attending Nurse</td>
<td>:</td>
<td><input name="nurse" type="text" maxlength="15" value="<?php echo $row["NURSE"]; ?>"></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td><input type="submit" name="Submit" value="Update"></td>
</form>
</tr>
</table>
</td>
</form>
</tr>
</table>
<?php } ?>
Then finally the update.php
<?php
$con = mysql_connect("localhost","","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("Hospital", $con);
mysql_query("UPDATE t2 SET HOSPNUM ='$_POST[hnum]', ROOMNUM='$_POST[rnum]', ADATE='$_POST[adate]', ADTIME='$_POST[adtime]', LASTNAME='$_POST[lname]', FIRSTNAME='$_POST[fname]', MIDNAME='$_POST[mname]', CSTAT='$_POST[cs]', AGE='$_POST[age]', BDAY='$_POST[bday]', ADDRESS='$_POST[ad]', SEX='$_POST[sex]',
STAT='$_POST[stats1]', STAT2='$_POST[stats2]', STAT3='$_POST[stats3]', STAT4='$_POST[stats4]', STAT5='$_POST[stats5]', STAT6='$_POST[stats6]', STAT7='$_POST[stats7]', STAT8='$_POST[stats8]', NURSE='$_POST[nurse]'
WHERE PNUM ='$_POST[pnum]'");
echo "<script>alert('Data Successfully Updated')</script>";
mysql_close($con)
?>
The problem is, I didn't show the text box corresponding to the pnum(primary key) to prevent it from being updated. Do you know of any technique that would not allow the pnum to be updated even if the text box corresponding to it is shown?
if you don't want to update it, but still need it in your query you can do:
UPDATE `table` SET `col` = `col` WHERE `id` = …
Related
Here is what I am trying to do. I have a dropdown (and or excel type look) that I need to pull data from the database. When I have an item selected I need to pass the info to the next page via a session. I have the drop down pulling from the database but I need to list Name and address in the dropdown.
If this is not possible I can do a list of items from a search but I will need to make the id a link to pass the id to the next page where I need to build a report.
If you can give me some info on this I would appreciate it.
Here is what I have for code on the dropdown
Code: Select all
<?php
// declare database connection variables.
$host = "localhost";
$username = "root";
$password = "";
$db_name = "sample";
$tbl_name = "tbl_report";
// connect to server and select database.
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");
$sql = "SELECT id, name, address FROM $tbl_name";
$result = mysql_query($sql) or die(mysql_error());
$dropdown = "<form action='report.php' method='post'>";
$dropdown .= "<select name='items' class='select'>";
while ($row = mysql_fetch_assoc($result)) {
$dropdown .= '<option value="' . $row['id'] . '">' .
$row['name'] . ' - ' . $row['address'] . '</option>';;
}
$dropdown .= "\r\n</select>";
$dropdown .= "<input type='submit' name='submit' value='Submit'>";
$dropdown .= "</form>"; //closing the form tag
echo $dropdown;
?>
What I need to do is pass the ID to the next page and have the $id show up in the code for my next sql statement.
Here is the code that I have for the next page sql statement.
select * from $tbl_name where id = (this is where I get hung up on.)
What I need is a way to pass the $row['id'] to the next page and put that in the sql code and then use the get method to display the info on the form of that page.
Here is the setup of the pages. select-report.php (this is where the drop down is) --> report.php.
Here is the form for report.php where i need to carry over the value of id and do a sql of select * from $tbl_name where id=[$post=items]; Then i need to use the $get to put all the items in the form below:
<form id="form1" name="form1" method="post" action="">
<table width="100%" border="0" cellspacing="4" cellpadding="4">
<tr>
<td width="20%">Water Purveyor
<input name="water-purveyor" type="text" id="water-purveyor" size="35" />
</td>
<td colspan="2">Facility Contact
<input type="text" name="facility-contact" id="facility-contact" /></td>
<td colspan="2">Facility Address
<input type="text" name="facility-address" id="facility-address" /></td>
</tr>
<tr>
<td>Manufacturer
<input type="text" name="manufacturer" id="manufacturer" /></td>
<td width="20%">State
<select name="state" id="state">
</select></td>
<td width="20%">Model #
<input name="model-num" type="text" id="model-num" size="10" /></td>
<td width="20%">Serial #
<input name="serial-num" type="text" id="serial-num" size="10" /></td>
<td width="20%">Meter #
<input name="meter-num" type="text" id="meter-num" size="10" /></td>
</tr>
<tr>
<td>Owner
<input type="text" name="owner" id="owner" /></td>
<td>Phone #
<input name="phone-num" type="text" id="phone-num" size="12" /></td>
<td>Caged
<input type="checkbox" name="caged" id="caged" /></td>
<td>Locked
<input type="checkbox" name="locked" id="locked" /></td>
<td>Code key
<input name="code-key" type="text" id="code-key" size="6" /></td>
</tr>
<tr>
<td colspan="2">Owner Address
<input name="owner-address" type="text" id="owner-address" size="50" /></td>
<td>Owner City
<input type="text" name="owner-city" id="owner-city" /></td>
<td>Owner State
<select name="owner-state" id="owner-state">
</select></td>
<td>Owner Zip
<input name="owner-zip" type="text" id="owner-zip" size="10" /></td>
</tr>
<tr>
<td>Contact
<input type="text" name="contact" id="contact" /></td>
<td>Contact Phone
<input name="contact-phone" type="text" id="contact-phone" size="10" /></td>
<td> </td>
<td>Other</td>
<td> </td>
</tr>
<tr>
<td colspan="2">Facility Name
<input name="facility-name" type="text" id="facility-name" size="40" /></td>
<td colspan="3">Assembly Address
<input name="assembly-address" type="text" id="assembly-address" size="75" /></td>
</tr>
<tr>
<td colspan="5">Onsite Location
<input name="onsite-location" type="text" id="onsite-location" size="75" /></td>
</tr>
<tr>
<td colspan="5">email Address
<input name="email" type="text" id="email" size="125" /></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>SHUTOFF VALVES</td>
<td colspan="2"><table width="100%" border="0" cellspacing="4" cellpadding="4">
<tr>
<td>N/A</td>
<td>Good</td>
<td>Poor</td>
<td>Fail</td>
</tr>
</table></td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>Valve 1</td>
<td colspan="2"><table width="100%" border="0" cellspacing="4" cellpadding="4">
<tr>
<td><input type="checkbox" name="v1-na" id="v1-na" /></td>
<td><input type="checkbox" name="v1-good" id="v1-good" /></td>
<td><input type="checkbox" name="v1-poor" id="v1-poor" /></td>
<td><input type="checkbox" name="v1-fail" id="v1-fail" /></td>
</tr>
</table></td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>Valve 2</td>
<td colspan="2"><table width="100%" border="0" cellspacing="4" cellpadding="4">
<tr>
<td><input type="checkbox" name="v2-na" id="v2-na" /></td>
<td><input type="checkbox" name="v2-good" id="v2-good" /></td>
<td><input type="checkbox" name="v2-poor" id="v2-poor" /></td>
<td><input type="checkbox" name="v2-fail" id="v2-fail" /></td>
</tr>
</table></td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>Assembly Replacement?
<input type="checkbox" name="assembly-replacement" id="assembly-replacement" /></td>
<td>if yes Serial #
<input type="text" name="assembly-replacement-serial" id="assembly-replacement-serial" /></td>
<td>New Installation
<input type="checkbox" name="new-install" id="new-install" /></td>
<td>Permit #
<input type="text" name="permit-num" id="permit-num" /></td>
<td> </td>
</tr>
<tr>
<td>Containment
<input type="checkbox" name="containment" id="containment" /></td>
<td>Isolation
<input type="checkbox" name="isolation" id="isolation" /></td>
<td colspan="2">Assembly Ground Clearance
<input type="text" name="assembly-ground-clearance" id="assembly-ground-clearance" /></td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>Domestic
<input type="checkbox" name="domestic" id="domestic" /></td>
<td>Irrigation
<input type="checkbox" name="irrigation" id="irrigation" /></td>
<td>Fire Line
<input type="checkbox" name="fire-line" id="fire-line" /></td>
<td>Alarmed Fire Line
<input type="checkbox" name="alarmed-fire-line" id="alarmed-fire-line" /></td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td colspan="2"><strong><em><u>Double Check Balve Assembly Repair</u></em></strong></td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>Repairs</td>
<td>Check Valve 1</td>
<td> </td>
<td>Check Valve 2</td>
<td> </td>
</tr>
<tr>
<td rowspan="3"> </td>
<td>Cleaned
<input type="checkbox" name="cv1-repair-cleaned" id="cv1-repair-cleaned" /></td>
<td> </td>
<td>Cleaned
<input type="checkbox" name="cv2-repair-cleaned" id="cv2-repair-cleaned" /></td>
<td> </td>
</tr>
<tr>
<td><strong>Replaced</strong></td>
<td> </td>
<td><strong>Replaced</strong></td>
<td> </td>
</tr>
<tr>
<td>Rubber Kit
<input type="checkbox" name="cv1-rubber-kit" id="cv1-rubber-kit" /></td>
<td> </td>
<td>Rubber Kit
<input type="checkbox" name="cv2-rubber-kit" id="cv2-rubber-kit" /></td>
<td> </td>
</tr>
<tr>
<td> </td>
<td>Other
<input type="checkbox" name="cv1-other" id="cv1-other" /></td>
<td> </td>
<td>Other
<input type="checkbox" name="cv2-other" id="cv2-other" /></td>
<td> </td>
</tr>
<tr>
<td> </td>
<td colspan="2">Comments
<textarea name="cv1-other-comments" id="cv1-other-comments" cols="45" rows="5"></textarea></td>
<td colspan="2">Comments
<textarea name="cv2-other-comments" id="cv2-other-comments" cols="45" rows="5"></textarea></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td colspan="2">Initial Test By
<input name="initial-test-by" type="text" id="initial-test-by" size="50" /></td>
<td colspan="2">Certified Tester #
<input type="text" name="certified-tester-num" id="certified-tester-num" /></td>
<td>Test Date/Time
<input type="text" name="test-date-time" id="test-date-time" /></td>
</tr>
<tr>
<td>Pass
<input type="checkbox" name="initial-test-pas" id="initial-test-pas" /></td>
<td>Fail
<input type="checkbox" name="initial-test-fail" id="initial-test-fail" /></td>
<td colspan="2">Calib Expire Date
<input type="text" name="calib-expire-date" id="calib-expire-date" /></td>
<td>Guage Serial #
<input type="text" name="gague-serial-num" id="gague-serial-num" /></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td colspan="2">Repair Test By
<input name="repair-test-by" type="text" id="repair-test-by" size="50" /></td>
<td colspan="2">Repair Date/Time
<input type="text" name="repair-date-time" id="repair-date-time" /></td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td colspan="2">Final Test by
<input name="final-test-by" type="text" id="final-test-by" size="50" /></td>
<td colspan="2">Certified Tester #
<input type="text" name="ft-certified-tester-num" id="ft-certified-tester-num" /></td>
<td>Test Date/Time
<input type="text" name="ft-date-time" id="ft-date-time" /></td>
</tr>
<tr>
<td>Pass
<input type="checkbox" name="ft-pass" id="ft-pass" /></td>
<td>Fail
<input type="checkbox" name="ft-fail" id="ft-fail" /></td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td colspan="5">Comments
<textarea name="comments" id="comments" cols="80" rows="5"></textarea></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td colspan="2">Video upload <input type="file" name="uploadvideo" /></td>
<td colspan="2">Image 1 <input type="file" name="uploadimage" /></td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td colspan="2">Image 2 <input type="file" name="uploadimage2" /></td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td colspan="2">Image 3 <input type="file" name="uploadimage3" /></td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td colspan="2">Image 4 <input type="file" name="uploadimage4" /></td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td colspan="2">Image 5 <input type="file" name="uploadimage5" /></td>
<td> </td>
</tr>
</table>
</form>
you can use jquery when to get the selected value like this
$("#dropdownid").change(function({ var vals = $(this).val(); })
then when you are redirecting to next page then add it as get parameter
(report.php)
if(isset($_REQUEST['submit'])){
$option = $_POST['items'];
mysql_query("SELECT * FROM `table_name` WHERE FIELD_NAME = '$options'");
}
if(isset($_REQUEST['submit'])){
$option = $_REQUEST['items'];
mysql_query("SELECT * FROM `table_name` WHERE FIELD_NAME = '$options'");
}
You can pass value to next page using php session.
$_SESSION ['name'] = $value;
and you can get value using php session from next page.
$value = $_SESSION ['name'];
Ihave this code that send an email with attachmant and its was working fine, but i did change the message body to have an email with a form look the problem i can't get the data to be showen in mt text box
$rowSQL = mysql_query( "SELECT MAX( ID ) AS max FROM `consulta` ;" );
$row = mysql_fetch_array( $rowSQL );
$largestNumber = $row['max'];
//echo $largestNumber;
$allData = mysql_query("SELECT * FROM `consulta` WHERE ID = $largestNumber;" );
while($rows = mysql_fetch_array($allData)) {
$email =$rows['EMAIL'];
$depto = $rows['N_DPTO'];
// NEW
$nombre = $rows['NOMBRE1'];
$apeellido = $rows['APELLIDO1'];
$dni = $rows['DNI'];
$phone = $rows['TELF'];
$direccion = $rows['DIRECCION'];
$date = $rows['DATE'];
$refrencia = $rows['REFERENCIA'];
$nestac = $rows['N_ESTACIONAMIENTO'];
$deposito = $rows['N_DEPOSITO'];
$dptoprice = $rows['P_DPTO'];
$esprice = $rows['P_ESTACIONAMIENTO'];
$depoprice = $rows['P_DEPOSITO'];
$separacion = $rows['SEPARACION'];
$cuota = $rows['CUOTA'];
$montofin = $rows['MONTO_FIN'];
$entidadfin = $rows['ENTIDAD_FIN'];
$observacion = $rows['OBSERVACIONES'];
$ncotizacion = $rows['N_COTIZACION'];
$user = $rows['USER_ID'];
// END NEW
echo $email;
echo $depto;
}
and the HTML message :
$message = '<html>
<body>
<table width="639" border="0">
<tr>
<td height="38" colspan="6"><h2>Gracias por tu visita
<label for="dpto"></label>
</h2></td>
</tr>
<tr>
<td width="148">Depto</td>
<td width="144"><input name="dpto" type="text" id="dpto" value="<?php echo $depto;?>" /></td>
<td width="3"> </td>
<td width="8"> </td>
<td width="136">Vendedor</td>
<td width="174" nowrap="nowrap"><label for="cotizacion">
<input name="user" type="text" id="user" value="" />
</label></td>
</tr>
<tr>
<td>Fecha</td>
<td><label for="esta">
<input name="date" type="text" id="date" value="$" />
</label></td>
<td> </td>
<td> </td>
<td>Documento</td>
<td nowrap="nowrap"><label for="deposito">
<input name="cotizacion" type="text" id="cotizacion" value="$" />
</label></td>
</tr>
<tr>
<td>Estacionamiento</td>
<td><input name="esta" type="text" id="esta" value="$" /></td>
<td> </td>
<td> </td>
<td>Deposito</td>
<td nowrap="nowrap"><input name="deposito" type="text" id="deposito" value="$" /></td>
</tr>
<tr>
<td height="64" colspan="6" valign="middle"><h2>Datos Del Cliente</h2></td>
</tr>
<tr>
<td>Nombre</td>
<td><input name="name" type="text" id="name2" value="$" /></td>
<td> </td>
<td> </td>
<td>Apellido</td>
<td nowrap="nowrap"><input name="family" type="text" id="family" value="$" /></td>
</tr>
<tr>
<td>DNI</td>
<td><input name="dni" type="text" id="dni" value="$" /></td>
<td> </td>
<td> </td>
<td> </td>
<td nowrap="nowrap"> </td>
</tr>
<tr>
<td height="32">Telf</td>
<td><input name="telf" type="text" id="telf" value="$" /></td>
<td> </td>
<td> </td>
<td>Email</td>
<td nowrap="nowrap"><input name="email" type="text" id="email" value="$" /></td>
</tr>
<tr>
<td>Direccion</td>
<td colspan="5"><input name="address" type="text" id="address" value="$" size="74" /></td>
</tr>
<tr>
<td>Como se Entero</td>
<td colspan="5"><input name="como" type="text" id="como" value="$" size="74" /></td>
</tr>
<tr>
<td height="56" colspan="6"><h2>Datos Financieros</h2></td>
</tr>
<tr>
<td>Precio Dpto S/.</td>
<td><input name="pDpto" type="text" id="pDpto" value="$" /></td>
<td> </td>
<td> </td>
<td>Precio Estacio S/.</td>
<td nowrap="nowrap"><input name="pEsta" type="text" id="pEsta" value="$" /></td>
</tr>
<tr>
<td>Precio Deposito S/.</td>
<td><input name="pDeposito" type="text" id="pDeposito" value="$" /></td>
<td> </td>
<td> </td>
<td>Separacion S/.</td>
<td nowrap="nowrap"><input name="separacion" type="text" id="separacion" value="$" /></td>
</tr>
<tr>
<td>Cuota S/.</td>
<td><input name="couta" type="text" id="couta" value="$" /></td>
<td> </td>
<td> </td>
<td>Monto Financia</td>
<td nowrap="nowrap"><input name="monto" type="text" id="monto" value="$" /></td>
</tr>
<tr>
<td>Entidad Financia</td>
<td><input name="entidad" type="text" id="entidad" value="$" /></td>
<td> </td>
<td> </td>
<td> </td>
<td nowrap="nowrap"> </td>
</tr>
<tr>
<td>Observaciones</td>
<td colspan="5"><textarea name="oserv" id="oserv" cols="58" rows="5"></textarea></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td nowrap="nowrap"> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td nowrap="nowrap"> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td nowrap="nowrap"> </td>
</tr>
</table>
</body>
</html>';
i do get the form look email but in the textbox i get so how can i have to show the value in the text box ???
The html form is a php string so you will have to end it to display the php value:
<input name="dpto" type="text" id="dpto" value="'.$depto.'" />
notice the single quote and dot before the variable $depto then the dot and single quote after. when you output the $message variable it will output the value of $depto
You need to reference the variables that contain the text you want to display, and because you're using single quotes instead of double quotes you have to close the quotes on your $message and use the single dot to join the variable with your text, like this:
<textarea name="oserv" id="oserv" cols="58" rows="5">'.$oserv.'</textarea>
Or:
<input name="date" type="text" id="date" value="'.$date.'" />
For future reference, if you used double quotes, you could reference the variables like this (but you'd need to escape all double quotes in your string with a \):
$message = "<input name=\"date\" type=\"text\" id=\"date\" value=\"{$date}\" />";
I an working on a HTML form to help me keep track on information when I play roll playing games.
The form has a grid of checkboxes that are used to track health. I also have a text box that I track other stats in.
I want to have a 2 buttons: LOAD and SAVE.
When save is hit the current status (whether or not a box is marked), if every form element is saved to a text file Save/save.txt. Any information in a existing text file should be replaced. I only care about the current settings.
when load is hit the data is loaded from the text file and the form is filled out like it was when it was saved.
How do I get this form to save / load?
<form action="HP_Tracker.php" method="post">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><center><b>W</b></center></td>
<td> </td>
</tr>
<tr>
<td bgcolor="ffffff"><input name="W1" type="checkbox" value="" /></td>
<td bgcolor="000000"><input name="S24" type="checkbox" value="" /></td>
</tr>
<tr>
<td bgcolor="ffffff"><input name="W2" type="checkbox" value="" /></td>
<td bgcolor="000000"><input name="S23" type="checkbox" value="" /></td>
</tr>
<tr>
<td bgcolor="F0F0F5"><input name="W3" type="checkbox" value="" /></td>
<td bgcolor="0A0A0F"><input name="S22" type="checkbox" value="" /></td>
</tr>
<tr>
<td bgcolor="E0E0EB"><input name="W4" type="checkbox" value="" /></td>
<td bgcolor="14141F"><input name="S21" type="checkbox" value="" /></td>
</tr>
<tr>
<td bgcolor="D1D1E0"><input name="W5" type="checkbox" value="" /></td>
<td bgcolor="1F1F2E"><input name="S20" type="checkbox" value="" /></td>
</tr>
<tr>
<td bgcolor="C2C2D6"><input name="W6" type="checkbox" value="" /></td>
<td bgcolor="29293D"><input name="S19" type="checkbox" value="" /></td>
</tr>
<tr>
<td bgcolor="B2B2CC"><input name="W7" type="checkbox" value="" /></td>
<td bgcolor="33334C"><input name="S18" type="checkbox" value="" /></td>
</tr>
<tr>
<td bgcolor="A3A3C2"><input name="W8" type="checkbox" value="" /></td>
<td bgcolor="3D3D5C"><input name="S17" type="checkbox" value="" /></td>
</tr>
<tr>
<td bgcolor="9494B8"><input name="W9" type="checkbox" value="" /></td>
<td bgcolor="47476B"><input name="S16" type="checkbox" value="" /></td>
</tr>
<tr>
<td bgcolor="8585AD"><input name="W10" type="checkbox" value="" /></td>
<td bgcolor="52527A"><input name="S15" type="checkbox" value="" /></td>
</tr>
<tr>
<td bgcolor="7575A3"><input name="W11" type="checkbox" value="" /></td>
<td bgcolor="5C5C8A"><input name="S14" type="checkbox" value="" /></td>
</tr>
<tr>
<td bgcolor="666699"><input name="W12" type="checkbox" value="" /></td>
<td bgcolor="666699"><input name="S13" type="checkbox" value="" /></td>
</tr>
<tr>
<td bgcolor="5C5C8A"><input name="W13" type="checkbox" value="" /></td>
<td bgcolor="7575A3"><input name="S12" type="checkbox" value="" /></td>
</tr>
<tr>
<td bgcolor="52527A"><input name="W14" type="checkbox" value="" /></td>
<td bgcolor="8585AD"><input name="S11" type="checkbox" value="" /></td>
</tr>
<tr>
<td bgcolor="47476B"><input name="W15" type="checkbox" value="" /></td>
<td bgcolor="9494B8"><input name="S10" type="checkbox" value="" /></td>
</tr>
<tr>
<td bgcolor="3D3D5C"><input name="W16" type="checkbox" value="" /></td>
<td bgcolor="A3A3C2"><input name="S9" type="checkbox" value="" /></td>
</tr>
<tr>
<td bgcolor="33334C"><input name="W17" type="checkbox" value="" /></td>
<td bgcolor="B2B2CC"><input name="S8" type="checkbox" value="" /></td>
</tr>
<tr>
<td bgcolor="29293D"><input name="W18" type="checkbox" value="" /></td>
<td bgcolor="C2C2D6"><input name="S7" type="checkbox" value="" /></td>
</tr>
<tr>
<td bgcolor="1F1F2E"><input name="W19" type="checkbox" value="" /></td>
<td bgcolor="D1D1E0"><input name="S6" type="checkbox" value="" /></td>
</tr>
<tr>
<td bgcolor="14141F"><input name="W20" type="checkbox" value="" /></td>
<td bgcolor="E0E0EB"><input name="S5" type="checkbox" value="" /></td>
</tr>
<tr>
<td bgcolor="0A0A0F"><input name="W21" type="checkbox" value="" /></td>
<td bgcolor="F0F0F5"><input name="S4" type="checkbox" value="" /></td>
</tr>
<tr>
<td bgcolor="000000"><input name="W22" type="checkbox" value="" /></td>
<td bgcolor="FFFFFF"><input name="S3" type="checkbox" value="" /></td>
</tr>
<tr>
<td bgcolor="000000"><input name="W23" type="checkbox" value="" /></td>
<td bgcolor="FFFFFF"><input name="S2" type="checkbox" value="" /></td>
</tr>
<tr>
<td bgcolor="000000"><input name="W24" type="checkbox" value="" /></td>
<td bgcolor="FFFFFF"><input name="S1" type="checkbox" value="" /></td>
</tr>
<tr>
<td> </td>
<td><center><b>S</b></center></td>
</tr>
</table>
<hr />
Initiative<br />
<input name="Initiative" type="text" size="4" />
<br /><br />
<input name="Save" type="submit" value="SAVE" />
</form>
Try that:
<?php
if (!empty($_POST)) {
$data = implode(',', $_POST);
$fileName = 'yourFile.txt';
$file = fopen($fileName, 'a+');
fwrite($file, $data);
fclose($file);
chmod(0777);
}
How do I setup data types in php, so that only integer or varchar, etc can be entered on a certain textbox. And if an incorrect value is inputted, a script would appear.
Please, what's the syntax for this?
<form name="form1" method="post" action="new.php">
<td>
<table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF">
<tr>
<td colspan="16" style="background:#9ACD32; color:white; border:white 1px solid; text-align: center"><strong><font size="3">UPDATE IN-PATIENT INFORMATION SHEET</strong></td>
</tr>
<tr>
<td width="54"><font size="3">Hospital #</td>
<td width="3">:</td>
<td width="168"><input name="hnum" type="text" id="hospnum"></td>
<td width="41"><font size="3">Room #</td>
<td width="3">:</td>
<td width="168"><input name="rnum" type="text" id="rnum"></td>
<td width="67"><font size="3">Date</td>
<td width="3">:</td>
<td width="168"><input name="adate" type="text" id="adate">
<td width="67"><font size="3">Time</td>
<td width="3">:</td>
<td width="168"><input name="adtime" type="text" id="adtime">
</td>
</tr>
<tr>
<td><font size="3">Last Name</td>
<td>:</td>
<td><input name="lname" type="text" id="lname"></td>
<td><font size="3">First Name</td>
<td>:</td>
<td><input name="fname" type="text" id="fname"></td>
<td><font size="3">Middle Name</td>
<td>:</td>
<td><input name="mname" type="text" id="mname"></td>
</tr>
<tr>
<td><font size="3">Civil Status</td>
<td>:</td>
<td><input name="cs" type="text" id="cs"></td>
<td><font size="3">Age</td>
<td>:</td>
<td><input name="age" type="text" id="age"></td>
<td><font size="3">Birthday</td>
<td>:</td>
<td><input name="bday" type="text" id="bday"></td>
</tr>
<tr>
<td><font size="3">Address</td>
<td>:</td>
<td><input name="ad" type="text" id="ad"></td>
<td><font size="3">Telephone #</td>
<td>:</td>
<td><input name="telnum" type="text" id="telnum"></td>
<td width="23"><font size="3">Sex</td>
<td width="3">:</td>
<td width="174"><input name="sex" type="text" id="sex"></td>
</tr>
<tr>
<td><font size="3">Pls. Check</td>
<td>:</td>
<input type='hidden' name="stats1" value="0">
<td><input name="stats1" type="checkbox" id="SSS" value="SSS">SSS</td>
<td><font size="3"></td>
<td>:</td>
<input type='hidden' name="stats2" value="0">
<td><input name="stats2" type="checkbox" id="nonmed" value="NonMedicare">Non Medicare</td>
<td><font size="3"></td>
<td>:</td>
<input type='hidden' name="stats3" value="0">
<td><input name="stats3" type="checkbox" id="sh" value="stockholder">Stockholder</td>
</tr>
<tr>
<td><font size="3"></td>
<td></td>
<input type='hidden' name="stats4" value="0">
<td><input name="stats4" type="checkbox" id="gsis" value="GSIS">GSIS</td>
<td><font size="3"></td>
<td></td>
<input type='hidden' name="stats5" value="0">
<td><input name="stats5" type="checkbox" id="senior" value="seniorcitizen">Senior-Citizen</td>
<tr>
<td><font size="3"></td>
<td></td>
<input type='hidden' name="stats6" value="0">
<td><input name="stats6" type="checkbox" id="dep" value="dependent">Dependent</td>
<td><font size="3"></td>
<td></td>
<input type='hidden' name="stats7" value="0">
<td><input name="stats7" type="checkbox" id="emp" value="employee">Employee</td>
<td><font size="3"></td>
<td></td>
<input type='hidden' name="stats8" value="0">
<td><input name="stats8" type="text" id="" value="">Others</td>
</tr>
<tr>
<td><font size="3">Admitting/Attending Nurse</td>
<td>:</td>
<td><input name="nurse" type="text" id="nurse"></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td><input type="submit" name="Submit" value="Search"></td>
</form>
The code you pasted is for an HTML form. You can use different input types and/or Javascript to control the type of input on the front-end. When the data is POSTed to the back-end you can then use PHP to validate that the form elements entered match the data types you are expecting.
I could be wrong but I believe in your new.php page you would have to verify each of the fields you want manually.
Check out:
http://www.phpro.org/tutorials/Validating-User-Input.html
What's wrong with my code, Im just a beginner. The error said it was an undefined index.
A record is added to mysql but its just 0's. What' s the proper way of doing this
$con = mysql_connect("localhost","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("Hospital", $con);
$hospnum = mysql_real_escape_string($_POST['HOSPNUM']);
$rnum = mysql_real_escape_string($_POST['ROOMNUM']);
$adate = mysql_real_escape_string($_POST['ADATE']);
$adtime = mysql_real_escape_string($_POST['ADTIME']);
$lname = mysql_real_escape_string($_POST['LASTNAME']);
$fname = mysql_real_escape_string($_POST['FIRSTNAME']);
$mname = mysql_real_escape_string($_POST['MIDNAME']);
$cs = mysql_real_escape_string($_POST['CSTAT']);
$age = mysql_real_escape_string($_POST['AGE']);
$ad = mysql_real_escape_string($_POST['ADDRESS']);
$bday = mysql_real_escape_string($_POST['BDAY']);
$telnum = mysql_real_escape_string($_POST['TELNUM']);
$sex = mysql_real_escape_string($_POST['SEX']);
$stats1 = mysql_real_escape_string($_POST['STAT']);
$stats2 = mysql_real_escape_string($_POST['STAT2']);
$stats3 = mysql_real_escape_string($_POST['STAT3']);
$stats4 = mysql_real_escape_string($_POST['STAT4']);
$stats5 = mysql_real_escape_string($_POST['STAT5']);
$stats6 = mysql_real_escape_string($_POST['STAT6']);
$stats7 = mysql_real_escape_string($_POST['STAT7']);
$stats8 = mysql_real_escape_string($_POST['STAT8']);
$nurse = mysql_real_escape_string($_POST['NURSE']);
$sqlque="INSERT INTO t2 (HOSPNUM, ROOMNUM, ADATE, ADTIME, LASTNAME, FIRSTNAME, MIDNAME, CSTAT, AGE, BDAY, ADDRESS, TELNUM, SEX, STAT, STAT2, STAT3, STAT4, STAT5, STAT6, STAT7, STAT8, NURSE)
VALUES ('$hospnum', '$rnum' , '$adate' , '$adtime', '$lname', '$fname', '$mname', '$cs', '$age', '$bday', '$ad', '$telnum', '$sex','$stats1', '$stats2', '$stats3', '$stats4', '$stats5', '$stats6', '$stats7', '$stats8', '$nurse')";
if (!mysql_query($sqlque,$con))
{
die('Error: ' . mysql_error());
}
echo "<script>alert('Record successfully added in Table In-patient!')</script>";
mysql_close($con)
?>
Here's the html form:
<html>
<head>
<script language="javascript" src="cal2.js">
/*
Xin's Popup calendar script- Xin Yang (http://www.yxscripts.com/)
Script featured on/available at http://www.dynamicdrive.com/
This notice must stay intact for use
*/
</script>
<script language="javascript" src="cal_conf2.js"></script>
</head>
<body onLoad="show_clock()">
<style>
input { font-size: 16px;}
</style>
<?php include('header.php'); ?>
<div id="main_content">
</div>
<?php include('footer.php'); ?>
</head>
<table width="900" border="0" align="left" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
<tr>
<form name="form1" method="post" action="aisaction.php">
<td>
<table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF">
<tr>
<td colspan="16" style="background:#9ACD32; color:white; border:white 1px solid; text-align: center"><strong><font size="3">Add In-Patient</strong></td>
</tr>
<tr>
<td width="54"><font size="3">Hospital #</td>
<td width="3">:</td>
<td width="168"><input name="hnum" type="text" id="hospnum" maxlength="4"></td>
<td width="41"><font size="3">Room #</td>
<td width="3">:</td>
<td width="168"><input name="rnum" type="text" id="rnum" maxlength="4"></td>
<td width="67"><font size="3">Date</td>
<td width="3">:</td>
<td width="168"><input name="adate" type="text" id="adate" maxlength="15">
<td width="67"><font size="3">Time</td>
<td width="3">:</td>
<td width="168"><input name="adtime" type="text" id="adtime" maxlength="15">
</td>
</tr>
<tr>
<td><font size="3">Last Name</td>
<td>:</td>
<td><input name="lname" type="text" id="lname" maxlength="15"></td>
<td><font size="3">First Name</td>
<td>:</td>
<td><input name="fname" type="text" id="fname" maxlength="15"></td>
<td><font size="3">Middle Name</td>
<td>:</td>
<td><input name="mname" type="text" id="mname" maxlength="15"></td>
</tr>
<tr>
<td><font size="3">Civil Status</td>
<td>:</td>
<td>
<select name="cs" id="cs">
<option>Single</option>
<option>Married</option>
<option>Widowed</option>
</select></td></td>
<td><font size="3">Age</td>
<td>:</td>
<td><input name="age" type="text" id="age" maxlength="3"></td>
<td><font size="3">Birthday</td>
<td>:</td>
<td><input name="bday" type="text" id="bday" maxlength="12">
</td>
</tr>
<tr>
<td><font size="3">Address</td>
<td>:</td>
<td><input name="ad" type="text" id="ad" maxlength="25"></td>
<td><font size="3">Telephone #</td>
<td>:</td>
<td><input name="telnum" type="text" id="telnum" maxlength="11"></td>
<td width="23"><font size="3">Sex</td>
<td width="3">:</td>
<td width="174"><input name="sex" type="text" id="sex" maxlength="1"></td>
</tr>
<tr>
<td><font size="3">Pls. Check</td>
<td>:</td>
<input type='hidden' name="stats1" value="0">
<td><input name="stats1" type="checkbox" id="SSS" value="SSS">SSS</td>
<td><font size="3"></td>
<td>:</td>
<input type='hidden' name="stats2" value="0">
<td><input name="stats2" type="checkbox" id="nonmed" value="NonMedicare">Non Medicare</td>
<td><font size="3"></td>
<td>:</td>
<input type='hidden' name="stats3" value="0">
<td><input name="stats3" type="checkbox" id="sh" value="stockholder">Stockholder</td>
</tr>
<tr>
<td><font size="3"></td>
<td></td>
<input type='hidden' name="stats4" value="0">
<td><input name="stats4" type="checkbox" id="gsis" value="GSIS">GSIS</td>
<td><font size="3"></td>
<td></td>
<input type='hidden' name="stats5" value="0">
<td><input name="stats5" type="checkbox" id="senior" value="seniorcitizen">Senior-Citizen</td>
<tr>
<td><font size="3"></td>
<td></td>
<input type='hidden' name="stats6" value="0">
<td><input name="stats6" type="checkbox" id="dep" value="dependent">Dependent</td>
<td><font size="3"></td>
<td></td>
<input type='hidden' name="stats7" value="0">
<td><input name="stats7" type="checkbox" id="emp" value="employee">Employee</td>
<td><font size="3"></td>
<td></td>
<input type='hidden' name="stats8" value="0">
<td><input name="stats8" type="text" id="" value="" maxlength="15">Others</td>
</tr>
<tr>
<td><font size="3">Admitting/Attending Nurse</td>
<td>:</td>
<td><input name="nurse" type="text" id="nurse" maxlength="15"></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td><input type="submit" name="Submit" value="Add"> <input type="reset" name="Reset" value="Reset"></td></td>
</form>
</tr>
</table>
</td>
</form>
</tr>
</table>
<table>
<tr><td>
</tr>
</table>
</html>
Here's the error:
Notice: Undefined index: HOSPNUM in C:\wamp\www\backup\kamikorosutengenmyo510\aisaction.php on line 15
Notice: Undefined index: ROOMNUM in C:\wamp\www\backup\kamikorosutengenmyo510\aisaction.php on line 16
Notice: Undefined index: ADATE in C:\wamp\www\backup\kamikorosutengenmyo510\aisaction.php on line 17
Notice: Undefined index: ADTIME in C:\wamp\www\backup\kamikorosutengenmyo510\aisaction.php on line 19
I would say, that form names and then $_POST variables have to have same case - they are case sensitive.
And you are having lowercase names in form and checking uppercase variables in $_POST
As c0mrade pointed out, do
var_dump($_POST);
and it will tell you what variables are really going to your script.