still dont work!
here's my complete code:
-----------------------------
MAIN.PHP3
<?
if($username && $password)
{
include("./Conn.php3");
//$loc="Location: http://$SERVER_NAME$SCRIPT_NAME";
$query = "SELECT TABLENAME, PRINCIPAL FROM secretDB where USERNAME='$username' and PASSWORD='$password'";
$tblname1 = mysql_query($query);
$tblname2 = mysql_query($query);
$num = mysql_num_rows($tblname1)
or die ("You're not authorized to be here. If you feel you have received this
message in error, please contact the <a
href=\"mailto:
software@idess.com\">webmaster</a>");
$num = mysql_num_rows($tblname2)
or die ("You're not authorized to be here. If you feel you have received this
message in error, please contact the <a
href=\"mailto:
software@idess.com\">webmaster</a>");
}
else
{
?>
<html>
<head>
<script language="javascript"><!--
function checkform ( form )
{
if (form.username.value == "") {
alert( "Please enter valid username.." );
form.username.focus();
return false ;
}
if (form.password.value == "") {
alert( "Please enter valid password.." );
form.password.focus();
return false ;
}
return true ;
}
//--></script>
<link rel="stylesheet" href="
http://www.idess.com/ca/style1.css">
<title>IDESS Login Form</title>
</head>
<body>
<form method="post" action="<?php echo($SCRIPT_NAME)?>" onsubmit="return checkform(this);">
<input type="hidden" name="principal" value="$PRINCIPAL">
<br>
<center><img src="idesslogo.gif" width="50" height="50" border="0"></center>
<br>
<center><strong>You have entered IDESS Secured Directory</strong></center>
<br>
<table border=0 cellspacing=0 cellpadding=0 width=320 align=center>
<tr><td colspan=2><center><img src="lock.gif" width="22" height="27" border="0"></center></td></tr>
<tr><td colspan=2> </td></tr>
<tr><td>
Username:
</td><td>
<input name="username" type="text" width=10>
</td></tr>
<tr><td>
Password:
</td><td>
<input name="password" type="password" width=10>
</td></tr>
<tr><td colspan=2> </td></tr>
<tr><td colspan=2 align="center">
<input name="submit" type="submit" value="Authorize">
</td></tr>
</table>
</form>
<?
die(); //This will prevent PHP from showing actual page. See above.
}
?>
<html>
<head>
<title>Page</title>
</head>
<frameset rows="117,54, *" framespacing=0 border=0 frameborder=0>
<frameset cols="90,245,*">
<frame name="header" src="header.htm" scrolling="no" noresize>
<frame name="topmenu" src="/ccess/<?php $i=0; while($row = mysql_fetch_array($tblname1)) { $i=$i + 1; $TBLENAME=$row["TABLENAME"]; $principal=$row["PRINCIPAL"]; printf("%s", $row["TABLENAME"]);} ?>/menu.php3" scrolling="no" noresize target="input">
<frame name="input" src="/ccess/<?php $ii=0; while($row = mysql_fetch_array($tblname2)) { $ii=$ii + 1; $TBLENAME=$row["TABLENAME"]; $principal=$row["PRINCIPAL"]; printf("%s" , $row["TABLENAME"]);} ?>/option1.php3" scrolling="no" noresize target="result">
</frameset>
<frame name="print" src="print.htm" scrolling="no" noresize>
<frame name="result" src="empty.htm" scrolling="auto" noresize>
</frameset><noframes></noframes>
</html>
----------------------------------------------------
the $principal variable must go here:
(OPTION.PHP3)
<html>
<head>
<head>
<link rel="stylesheet" href="
http://access/style1.css">
<title>Search Category Options</title>
<base target="result">
</head><body>
<br>
<br>
<br>
<br>
<br>
<!--//option dropdown start here-->
<?
include(".././Conn.php3");
<!--//WHEN CLICK THE FORM SUBMIT, THE VARIABLE MUST GO HERE, -->
$result = mysql_query("select DISTINCT COMPANY from dbase WHERE PRINCIPAL='$principal'");
$num_cols = mysql_num_rows($result);
$counter = 0;
echo "<FORM METHOD = \"POST\" ACTION=\"result1.php3\";\">\n";
echo "<table border=0 cellpadding=0 cellspacing=0 align=left width=350>\n";
echo "<tr><td> </td><td align=left>Search for:</td></tr>\n";
echo "<tr><td width=\"100\" align=right>Company: </td><td align=left>\n";
echo "<select name=\"company\">\n";
if ($company == "") {
echo "<option selected> </option>\n" ;
};
while($counter < $num_cols):
$opt = @mysql_result($result,$counter, "COMPANY");
echo "<option value='$opt'>$opt</option>\n" ;
$counter = $counter + 1;
endwhile;
echo "</select>\n";
echo "<INPUT TYPE=\"submit\" VALUE=\"Search\"></td></tr>\n";
echo "</table>\n";
echo "</FORM>\n";
?>
<!--//option dropdown ends here -->
</body>
</html>
WILL YOU PLEASE CHECK MY CODE?
ARMY