Jump to content

Radio button verification problem


mboley370

Recommended Posts

I am trying to alter a page my teammate made for our Senior Project Class so that it doesn't ask us to validate the radio buttons.  It seems like not matter what I take out it still validates the buttons.  What do i need to take out of this code?  I am very new with php, but understand how to use it to a certain extent.

 

 

 <?php require_once("../includes/userSession.php"); ?>
<?php require_once("../includes/connection.php"); ?>
<?php require_once("../includes/functions.php"); ?>
<?php manager_confirm_logged_in(); ?>
<?php
$message = "";
$found="true";
$numRows =0;
$errors=0;
$managerID = $_SESSION['contractManagerID'];
$srID = "";

if(isset($_GET['requestID'])){
$srID = $_GET['requestID'];
$query = "SELECT sr.clientID, cFirstName, cLastName, candidateRequestedID, srStatus, srClosed, srDate, srValid, sr.* ";	
$query .="FROM staffRequest AS sr, client AS c ";
$query .="WHERE staffRequestID =".$_GET['requestID']." AND c.clientID = sr.clientID"; 
$result_set = mysql_query($query);
confirm_query($result_set);

if (mysql_num_rows($result_set) == 1) {
$srRecord = mysql_fetch_array($result_set);
}else{
$message =	"There is no staff request with the staff request ID entered. Please go back and try again.";
//redirect_to('clientArea.php?searchError=1');
$found = "false";
}

}else{
$message = "Error: No Staff Request ID sent. Please go back to the manager area and try again.";
$found = "false";
}

if(isset($_GET['error']) && $_GET['error'] == 1 ){
$message = "You must select one candidate in order to close the staff request.";	
}


?>
<!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=utf-8" />
<title>TPS -Validate Staff Request </title>
<link href="../styles.css" rel="stylesheet" type="text/css" />
<script src="../SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
<link href="../SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.style1 {
color: #000000;
font-size: 24px;
font-weight: bold;
}
-->
</style>
</head>
<body>
<div id="mainContent" align="center">
  <div id="header">
    <div id="headerImg" align="left"><a href="../index.html"><img src="../images/tps_logo.png" width="226" height="67" border="opx" alt="Taylor Professional Services" /></a></div>
  </div>
  <div id="nav">
    <ul id="MenuBar1" class="MenuBarHorizontal">
      <li><a href="../aboutUs.html">About Us</a> </li>
      <li><a href="../services.html">Services</a></li>
      <li><a href="../clientLogin.php">Client Login</a></li>
      <li><a href="../staffLogin.php">Staff Login</a></li>
      <li><a href="../contactUs.html">Contact Us</a></li>
      <li><a href="managerLogout.php">Log Out</a></li>
    </ul>
     
    <script type="text/javascript">
<!--
var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgDown:"../SpryAssets/SpryMenuBarDownHover.gif", imgRight:"../SpryAssets/SpryMenuBarRightHover.gif"});
//-->
</script>
  </div>
  <div id="content">
  <form action="staffRequestValidate.php" method="post">
    <div align="left" style="padding:10px"><a class="backLinks" href="managerArea.php"><< Back to Manager Area page.</a></div>
<?php if (!empty($message) || ($message != "")) {echo "<div align=\"center\"><span class=\"errorMessage\">*** ".$message." ***</span></div>"; } ?>
  <div class="managerSections">
  <div class="greyBG">Validate Staff Request <?php echo $srID; ?></div>
  <p><br />
    
      <?php if( $srRecord['srValid'] == "Invalid"): ?>
      <?php if($found == "true") : ?>
    
    The status of this staff request is that it is: <b><?php echo $srRecord['srStatus']; ?></b><br />
    <br />
    The client's name is: <b><?php echo $srRecord['cFirstName']." ".$srRecord['cLastName']; ?></b><br />
    </p>
  <table>
  <tr><td colspan="4" align="center"><h3 align="left">Clients Specifications </h3></td>
    </tr>
    <tr>
      <td width="150px">Education</td>
      <td width="120px">Experience</td>
      <td width="100px">Location</td>
      <td width="100px">Salary</td>
    </tr>
    <tr>
      <td><b><?php echo $srRecord['srEducation']; ?> Degree</b></td>
      <td><b><?php echo $srRecord['srExperience']; ?> years</b></td>
      <td><b><?php echo $srRecord['srLocation']; ?></b></td>
      <td><b><?php echo $srRecord['srSalary']; ?> </b></td>
    </tr>
  </table>
  <p><br />
    The date this request was submitted: <b><?php echo substr($srRecord['srDate'],0,10); ?></b><br />
    <br />
    
    Select the candidate they chose for this staff request
  <p>
    <?php
$query2 = "SELECT * FROM candidatesRequested WHERE candidatesRequestedID =".$srRecord['candidateRequestedID'];
$result_set2 = mysql_query($query2);
confirm_query($result_set2);

if (mysql_num_rows($result_set2) == 1) {
$candidates = mysql_fetch_array($result_set2);	

$query3 = "SELECT staffMemberId, smFirstName, smLastName FROM staffMember ";
$query3 .= "WHERE staffMemberId IN (".$candidates['crCandidate1'].", ".$candidates['crCandidate2'].", ".$candidates['crCandidate3'].")";
$result_set3 = mysql_query($query3);
confirm_query($result_set3);

	echo "<table cellpadding=\"3px\">";
	echo "<TR>";
	echo "<TH>First Name</TH><TH>Last Name</TH>";
	echo "</TR>";
	while($staffMember = mysql_fetch_array($result_set3))
	{
		echo "<TR>";
		echo "<TD>", $staffMember['smFirstName'], "</TD><TD>", $staffMember['smLastName'],
		"</TD>";
		echo "</TR>";
		}
		echo "</TABLE>"; 

}else{
	echo "An error occurred while trying to retrieve candidates. Please email support about this problem.";	
}

  ?>
     <?php endif; ?>
     </p>
 <br>

  
  <table width="316" border="0">
  <tr><td colspan="2" align="center"><h3 align="left">Validate Staff Request </h3></td>
        </tr>
    <tr>
      <th width="122" scope="row"><div align="right"><strong>Valid:</strong> </div></th>
      <td width="184">
        <div align="left">
          <input name="srValidRadio" type="radio" value="Valid" />
          </div>
      </label></td>
    </tr>
    <tr>
      <th scope="row"><div align="right"><strong>Invalid:</strong> </div></th>
      <td><div align="left">
        <input name="srValidRadio" type="radio" value="InValid" />
      </div></td>
    </tr>
    <tr>
      <th scope="row"><div align="right"><strong>Unable To Fill:</strong>  </div></th>
      <td><div align="left">
        <input name="srValidRadio" type="radio" value="Unable to fill" />
      </div></td>
    </tr>
  </table>
  <p><br />
     <br />
     <input name="clientID" type="hidden" value="<?php echo $srRecord['clientID']; ?>" />
     <input name="staffRequestID" type="hidden" value="<?php echo $srID; ?>" />
      
<input name="submit" type="submit" value="Validate Staff Request" /><?php else : 
	echo "<b>Staff request ".$srID." is already valid. </b>"; ?>
  <?php endif; ?>
  </p>
  </form>
  </div>

  <br />
  <br />

</div>



<div id="footer">
  <table width="800px" align="center"cellpadding="1px;">
    <tr>
      <td><a href="../index.html">Home</a></td>
      <td>|</td>
      <td><a href="../aboutUs.html">About Us</a></td>
      <td>|</td>
      <td><a href="../services.html">Services</a></td>
      <td>|</td>
      <td><a href="../clientLogin.php">Client Login</a></td>
      <td>|</td>
      <td><a href="../staffLogin.php">Staff Login</a></td>
      <td>|</td>
      <td><a href="../contactUs.html">Contact Us</a></td>
      <td>|</td>
      <td><a href="clientLogout.php">Log Out</a></td>
      <td align="right" width="350px">© 2010 Taylor Professional Services</td>
    </tr>
  </table>
</div>
</body>
</html>


<?php
/*
  <table cellspacing="5px">
  <tr><td><b>Education:</b></td><td><?php echo $srRecord['srEducation']; ?> Degree</td></tr>
  <tr><td><b>Experience:</b></td><td><?php echo $srRecord['srExperience']; ?> years</td></tr>
  <tr><td><b>Location:</b></td><td><?php echo $srRecord['srLocation']; ?></td></tr>
  <tr><td><b>Salary:</b></td><td><?php echo $srRecord['srSalary']; ?> </td></tr></table> */


?>

 

Link to comment
Share on other sites

Since there is no validation on this page, I'm assuming it is not "staffRequestValidate.php".  Which is where all of the validation from this form resides.

 

Thanks I guess I overlooked this part, i thought i was putting the validation before the submit, but I just looked at the staffRequestValidate.php and its right at the top lol. 

 

I thought i was going crazy and just couldn't find it.

 

Thanks for the fast response.

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.