Morning,
I have a form for admins of a webpage to set up users and access, so I dont have to 🙂
The form for the access part is a bit problematic, because there has to be two rows added if the access selected is administrator. I can get it to submit twice but it only picks up the second value selected. I think its something in my "for" loop but I can never get that straight.
<form action="SubmitAcess.php" method="post">
<? for($i = 0; $i < 2; $i++)
{
echo "<select name='giSecurityLevel' size='1'>
<option value='1'>Administrator</option>
<option value='3'>Limited</option>
</select>";
} ?>
<input type="Submit"name="Submit" value="Submit">
</form>
Should I have the for loop on the form itself or the submit page? Any thoughts at all would be welcome.
Thanks
Laura
submit page:
<?
include ("connect.php");
$_POST['giSecurityLevel'] = $giSecurityLevel;
$_POST['iUser'] = $iUser;
for($i = 0; $i < 2; $i++)
{
$sql = "INSERT INTO tblAccess (giSecurityLevel,iUser)
VALUES ('$giSecurityLevel',$iUser')";
//$result = mssql_query($sql) or die;
echo $sql;
}
?>