after login, go to this page. client will click those button then view each recipe they click.
list.php
<?php
session_start();
if(!isset($_SESSION['myusername'])&&!isset($_SESSION['mypassword'])) {
header('Location:401.php');
}
?>
<!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>
<!--for auto refresh-->
<META HTTP-EQUIV=Refresh CONTENT="300; URL=http://localhost/recipe2/home.php">
<title>home</title>
</head>
<body>
<div align="left"><img src="Cookie Banner edited.jpg" width="1100" height="200" /></div>
<h2>My Account </h2>
<p>chef today : <?php echo $_SESSION['myusername']; ?> | <a href="logout.php">Logout</a> </p>
<p> </p>
<p> </p>
<form id="form1" name="form1" method="post" action="">
<table width="200" border="0" align="center">
<tr>
<td>
<label>
<div align="center">
<input type="submit" name="button" id="button" value="biskut" />
</div>
</label> </td>
</tr>
<tr>
<td><div align="center">
<input type="submit" name="button2" id="button2" value="kek" />
</div></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td><div align="center">
<input type="submit" name="button3" id="button3" value="minuman" />
</div></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td><div align="center">
<input type="submit" name="button4" id="button4" value="kuih raya" />
</div></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td><div align="center">
<input type="submit" name="button5" id="button5" value="puding" />
</div></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td><div align="center">
<input type="submit" name="button6" id="button6" value="western" />
</div></td>
</tr>
</table>
</form>
after select one of the button, will go to this page which view the detail follow the id_category (simple word following the button that they click)
home.php
<?php
session_start();
if(!isset($_SESSION['myusername'])&&!isset($_SESSION['mypassword'])) {
header('Location:401.php');
}
?>
<!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>
<!--for auto refresh-->
<META HTTP-EQUIV=Refresh CONTENT="300; URL=http://localhost/recipe2/home.php">
<title>home</title>
</head>
<body>
<div align="left"><img src="Cookie Banner edited.jpg" width="1100" height="200" /></div>
<h2>My Account </h2>
chef today : <?php echo $_SESSION['myusername']; ?> | <a href="logout.php">Logout</a>
<p> </p>
<p> </p>
<table width="1091" border="1" cellspacing="0" cellpadding="3">
<thead>
<th>no</th>
<th>name</th>
<th>ingredient</th>
<th>how to cook</th>
<th>category</th>
<th>action</th>
</thead>
<?php
include 'recipe2db.php';
$sql="SELECT r.*, c.category_name as nama_kategori FROM `recipe` r inner join category c on r.id_category=c.id_category order by r.id_category";
$result=mysql_query($sql);
$count=1;
// Start looping rows in mysql database.
while($rows=mysql_fetch_array($result)){
?>
<tr>
<td width ="15%"><div align="center"><? echo $count++ ?> </div> </td>
<td width="15%"><div align="center"><? echo $rows['name']; ?></div> </td>
<td width="25%"><div align="center"><? echo $rows['bahan']; ?></div> </td>
<td width="31%"><div align="center"><? echo $rows['cara']; ?></div> </td>
<td width="13%"><div align="center"><? echo $rows['nama_kategori']; ?></div> </td>
<td width="10%"><div align="center"><a href="delete.php?id=<? echo $rows['id']; ?>">delete</a>/<a href="update.php?id=<? echo $rows['id']; ?>">update</a></div></td>
</tr>
<?
// close while loop
}
// close connection
mysql_close();
?>
</table>
<form id="form1" name="form1" method="post" action="add.php">
<label>
<input type="submit" name="btnadd" id="btnadd" value="ADD new" />
</label>
</form>
</body>
</html>
dearest programmer, help me to solve this...