troubleshooting Question

Radio button results to sqlserver

Avatar of peter Ojeda
peter Ojeda asked on
PHP
14 Comments2 Solutions110 ViewsLast Modified:
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 = "";
 
}
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 2 Answers and 14 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 14 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros