Hi I am attempting to submit the values of my radiobuttons to my sqlserver database. I have been able to submit all other text fields so I know the connection and insert is working properly, I commented the radio buttons out so the form would work correctly, which it does, but with the radio buttons in I keep receiving the undefined index answer. Any suggestions on what I am doing wrong?
(in the form page)
<!-- <input type="radio" name="startup"
<?php if (isset($startup) && $startup=="startup") echo "";?>
value="startup">startup
<input type="radio" name="pitstop"
<?php if (isset($pitstop) && $pitstop=="pitstop") echo "";?>
value="pitstop">pitstop
<input type="radio" name="multifab"
<?php if (isset($multifab) && $multifab=="multifab") echo "";?>
value="multifab">multifab -->
(seperate insert page. I tried to define them this way since it worked in a previous form with drop down boxes results.)
$stmt = sqlsrv_query( $conn, $sql, $params);
if( $stmt === false ) {
die( print_r( sqlsrv_errors(), true));
}
else
{
echo "Record add successfully";
}
sqlsrv_close($conn);
if(isset($_POST['Submit']) )
{
$varpitstop = $_POST['pitstop'];
$varmultipfab = $_POST['multifab'];
$varstartup = $_POST['startup'];
$errorMessage = "";
}
Our community of experts have been thoroughly vetted for their expertise and industry experience.
The Most Valuable Expert award recognizes technology experts who passionately share their knowledge with the community, demonstrate the core values of this platform, and go the extra mile in all aspects of their contributions. This award is based off of nominations by EE users and experts. Multiple MVEs may be awarded each year.
This award recognizes an author who contributes the highest volume of original works or content. Recipients of this award produce extremely valuable content that prioritizes accuracy, relevancy, and professionalism.