Music Banter - View Single Post - Batch Programming
View Single Post
Old 10-19-2012, 12:49 AM   #20 (permalink)
Engine
air quote
 
Engine's Avatar
 
Join Date: Jun 2009
Location: pollen & mold
Posts: 3,112
Default

Quote:
Originally Posted by tore View Post
Although I'm somewhat familiar with php, combining that with database stuff is something I've never done before so I'm not much help. I'd be interested in seeing the answer, though.

If you need a die roller in batch, I'm your man.
I've done that!

Quote:
<html>
<head>
<title>Roll the Dice</title>
</head>
<body>
<h1>Roll The Dice</h1>
<form action="dice.php" method="GET">
<p>How many dice?</p>
<input size="4" name="Number">
<input type="submit" value="Roll the dice!">
</form>
<?
$number_of_dice = $_GET['Number'];
if ($number_of_dice) {
$count = 0;
while ($count < $number_of_dice){
$dieroll=rand(1,6);
print "<p>$dieroll</p>";
$total=$total+$dieroll;
$count++;
}
print "Total = $total";
}
?>
</body>
</html>
If you want, I'll show you the voting app once I figure it out. But I assure you it will look like shit compared to an MB poll.
__________________
Like an arrow,
I was only passing through.
Engine is offline   Reply With Quote