Php/Bankers Algorithm

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
liesense
Forum Newbie
Posts: 1
Joined: Sat Sep 24, 2011 3:50 am

Php/Bankers Algorithm

Post by liesense »

can any one help me out about my problem in my php i cant put the Max Tab in the right side of the Allocated tab is there anyone who can help me here please

<html>
<head></head>
<body>
<form method="post" action="OS.php">
Enter number of rows <input name="rows" type="text" size="4">
and columns <input name="columns" type="text" size="4">
<input type="submit" name="submit" value="Draw Table">
</form>

<?php
echo"<table border = 5%>";
$columns = $_POST['columns'];
for($i=1; $i<= $columns; $i++)
{

echo "Instance $i = "."<input type='text' size='2' name='r[]'>"." ";

}
echo"<br>Alocation Max Need Work";
if (isset($_POST['submit'])) {

// set variables from form input
$rows = $_POST['rows'];
$columns = $_POST['columns'];
// loop to create rows

for ($r = 1; $r <= $rows; $r++) {

// loop to create columns in Allocated
for ($c = 1; $c <= $columns;$c++) {
echo "<td><input type='text' name='input[".$r."][".$c."]' size='5' > </td>";
} echo "";
}

}


for ($r = 1; $r <= $rows; $r++) {

// loop to create columns in Max
for ($c = 1; $c <= $columns;$c++) {
echo "<td><input type='text' name='max[".$r."][".$c."]' size='5'></td> ";
} echo "";
}
echo"</table>";
?>
<br>
<br><input type="submit" name="submit" value="Submit">
<input type="reset" name="Reset">
</body>
</html>
User avatar
twinedev
Forum Regular
Posts: 984
Joined: Tue Sep 28, 2010 11:41 am
Location: Columbus, Ohio

Re: Php/Bankers Algorithm

Post by twinedev »

Can you give a little more explanation as to what you are trying to do?
Post Reply