<?php
if(isset($_SESSION['username'],$_SESSION['password']))
$role = $_SESSION['role'];
if($_SESSION["role"] == "member"){
?>
<form name ="add_cart" method="post" action="Shoppingcart.php" onSubmit="alert('Item added!')">
<input type='hidden' name='id' id="id" value='<?php echo $id; ?>'>
<input type="text" name="quantity" id="quantity" value="1" size="3" maxlength="3">
<input type="submit" name="Add" value="ADD TO CART" style="width:150px; background-color:black; border:none; color:White "/>
</td>
</form>
<?php
}}
?>
这是我的错误:
NOTICE: UNDEFINED INDEX: ROLE IN C:\XAMPP\HTDOCS\FYP2\FOODCATALOG.PHP ON LINE 181