|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
$_POST from a field in HTML form is blank
Linux
PHP 4 ?php include 'db.php'; $db = mysql_select_db("$database_name", $connection) or die("Couldn't select database."); // Define post fields into simple variables $TDesca = $_POST['CShipT']; $TDesca .= ": "; $Tdesca .= $_POST['Distm']; $Tdesca .= $_POST['Meas']; $TDesca .= "Par: "; $TDesca .= $_POST['Par']; $TDesca .= ": "; $TDesca .= "Rating: "; $Tdesca .= $_POST['Courat']; //'Rating: ' + $_POST['courat'] + ',Slope: ' + $_POST['sloprat']+'<br>'+$_POST['ment']+': ' + $_POST['distm1']+$_POST['dist1']+',Par: '+$_POST['par1']+',Rating: '+$_POST['courat1']+',Slop: '+$_POST['sloprat1']+'<br>'+$_POST['ment1']+' '+$_POST['distm2']+' '+$_POST['dist2']+',Par: '+$_POST['par']+',Rating: '+$_POST['courat2']+',Slope: '+$_POST['sloprat']+'<br>'; //$Td = addslashes($Tdesca); $TDesc1 = $_POST['TDesc1']; $Td1 = addslashes($TDesc1); $TDesc2 = $_POST['TDesc2']; $Td2 = addslashes($TDesc2); $Nghgolf = $_POST['Nghgolf']; $CourseD = $_POST['CourseD']; $TypeC = $_POST['TypeC']; $Fairway = $_POST['FairwayG']; $Green = $_POST['Green']; $Dist = $_POST['Distme']; $DistM = $_POST['DistMa']; /* Do some error checking on the form posted fields */ if(!$GolfClub){ echo 'You did not submit the following required information! <br />'; if(!$glfclbn){ echo "Golf Club Name is a required field. Please enter it below.<br />" . $TDesca; } include 'glfdet.htm'; // Show the form again! /* End the error checking and if everything is ok, we'll move on to creating the user account */ exit(); // if the error checking has failed, we'll exit the script! } // Enter info into the Database. // $info2 = htmlspecialchars($info); $sql = mysql_query("INSERT INTO glfdetails (golfclubname,howto,nocourse,Description,Desc1,Des c2,CourseDet,CourseDet1,CourseDet2,CourseD,Courset ype,Nightglf,FwayGrass,Greens,Dist,DistMarker) VALUES('$GolfClub','$Howtoos','$NCourse','$Desc',' $courname','$courname1','$CShipT','$Td1','$Td2','$ CourseD','$TypeC','$NghGolf','$fairway','$Greens', '$Dist','$DistM')") or die (mysql_error()); // // if(!$sql){ echo 'There has been an error writing to the datbase. Please contact the webmaster.'; } include 'glfdet.htm'; ?> the fields from my HTML form Distm and Meas when posted has blank values but I have already input a value in these fields. I do not understand why it did not capture the value. Can anyone help? Thanks. Bob |
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Database Help > $_POST from a field in HTML form is blank |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|