I have a small form (code snippet below) which allows the user to select the type of schedule they would like to display, the selection made via radio buttons. The form script calls itself upon submission, but the name/value attributes do not seem to pass themselves properly into variables. When I use HTTP_POST_VARS to check the value of "disp," the variable appears. The if statement below (if ($disp == 1)) doesn't work properly, however. In the section of code below the if statement is only used to mark the selected button as "checked." I realize that there are easier ways to handle checking the right button, but I will need the $disp value for the more important purpose of passing to my class functions to output the appropriate display. Am I missing something somewhere?
Thanks in advance,
Terwin
Thanks in advance,
Terwin
Code:
<?php
include('teachersched.php');
$sched = new TeacherSched;
$sched->CreateSched($sched);
?>
<table width=650 align=center border=1 cellpadding=1 cellspacing=1>
<tr>
<td bgcolor=#cccccc>
<center><font size=3 face=arial, helvetica>Teaching Schedule</font></center>
<br>
<form method=post action="<?php
echo $HTTP_SERVER_VARS["PHP_SELF"];
?>">
<font size=2 face=arial, helvetica>Show schedule for:</font>
<input type=radio name=disp value=1
<?php
if ($disp == 1)
{
echo "checked";
}