Jump to content

Old Code New Problems


scarface83

Recommended Posts

Hi i was wondering if anyone could help me with the below code its a form which posts back into itself so i can move on the the next drop down but it doesnt seem to be working and i have been starring at it for ages it used to work and nothing has changed ?

 

thanks

<?
	//echo "Site Down while making improvements  -" ,$days;
	//exit();


	session_start();
	print_r ($_SESSION);
	include('sess_vars.php');

	if($level >=1){echo "If you are seeing this you dont have sufficent rights to access this program? if not email rob please !!!!";}
	else
	{		

	if (isset($none_sel)) // if the loginerror variable is set then continue

			echo $none_sel; // 
			unset($_SESSION['none_sel']);	 // unregisters the session for  none_sel so it can be reset later in the script


	@$error = $_GET['error'];


	if($error=="1") { 
			echo ("Select an option below before submitting.");
			unset($error);  }


	require ('db_connect.inc'); // includes db connection details

	if(isset($teams)) 
		{ $set_teams = $_POST['teams']; }

	else { $set_teams="Please_Select";}

	$team_names = mysql_query("SELECT TeamRef,Teamname FROM a_team WHERE In_use='Y' AND Area='1' ORDER BY Teamname	")
	or die(mysql_error);

	if(isset($advisors)) 
		{ $set_advisors = $_POST['advisors']; }

	else { $set_advisors="Please_Select";}

	$advisor_names = mysql_query("SELECT nick FROM a_users WHERE In_use='Y'  AND Level='0' AND TeamRef='$set_teams' ORDER BY nick");	

	mysql_close();		

?>
<!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=iso-8859-1" />
<title>Absence Managment</title>	
<link href="style.css" rel="stylesheet" type="text/css" />

</head>
<body>	
	<div class="title"> <u>Absence Management</u></div>
	<div class="back"><a href="../main.php">Back</a></div>
	<form name="select_advisor" method="post" action="report_absence.php">
	  <br />
	    <table width="1395" border="0">
            <tr>
              <td width="865"><b><u>Please Select  the team, then the advisor you are reporting the absence for </u></b></td>
              </tr>
          </table>
	</div>
	</p>
	<table width="14%" border="1">
	<tr>
	<td width="78%"><div align="left">
	<select name="teams" onChange="this.form.submit();"> 

	<option value="Please_Select">Please Select</option> 


	<? 

	while($team_names_row = mysql_fetch_array($team_names)) {
	extract($team_names_row) 

	?>

	<? 

	if($set_teams==$TeamRef) { 

	?>
						  
	<option style="color:#FF0000" value="<? echo $TeamRef ?>" selected><? echo $Teamname; ?></option>

	<?	} else { ?>

	<option value="<? echo $TeamRef ?>"><? echo $Teamname; ?></option>

	<?	} ?>
	<?	} ?>

	</select>
	</div>
	</td>
<!-- 		<td width="22%"><input type="submit" name="Submit" value="Select"></td> -->
	</tr>
	<tr>
	<td><div align="left">
               
	<select name="advisors" onChange="this.form.submit();">
      
                 
			  <option value="Please_Select">Please Select</option>
                  
                  <? while($advisor_names_row = mysql_fetch_array($advisor_names)) {
					extract($advisor_names_row) ?>
                  <? if($set_advisors==$nick) { ?>
                  <option style="color:#FF0000" value="<? echo $nick ?>" selected><? echo $nick; ?></option>
                  <?	} else { ?>
                  <option value="<? echo $nick ?>"><? echo $nick; ?></option>
                  <?	} ?>
                  <?	} ?>
          </select>
                <label></label>
              </div></td>
<!-- 			  <td><input type="submit" name="Submit2" value="Select"></td> -->
      </tr></table>
	</form>
		<form name="form2" method="post" action="report_absence2.php">
		  <br />
		  <table border="1">
  	<td width="56"><input type="submit" name="Submit3" value="Submit" />
    </table>
              <input type="hidden" name="whats_sel" value="4" />
              <input type="hidden" value="<? echo $set_teams ?>" name="teams" />
              <input type="hidden" value="<? echo $set_advisors ?>" name="advisors" />
              
		</form>
            <p>
  
  <div class="footer"> 
</p>
            <p> </p>
</body>


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.