All pastes #94386 Raw Edit

Stuff

public text v1 · immutable
#94386 ·published 2006-07-21 06:59 UTC
rendered paste body
<?php
require_once ($addonDir.'conf.php');
if(isset($_POST['formsubmit'])){
$prices = array(
	'Dreamfoil' => '10',
	'Icecap'    => '15',
	'Gromsblood' => '8',
	'Black Lotus' => '20',
	'Stonescale Eel' => '10',
	'Mountain Silversage' => '5',
	'Golden Sansam'	=>	'6',
	'Flask of the Titans' => '200',
	'Flask of Supreme Power' => '200'
);

$total = $prices[$_POST['item']] * $_POST['quantity'];

$sqlquery = "INSERT INTO $table VALUES('$id','$name','$item','$quantity','$total')";

$results = mysql_query($sqlquery);

mysql_close();
print "<html><body><left>";
print "<p>You have just added this info:<p>";
print "Name : $name<br>";
print "Item: $item<br>";
print "Quantity: $quantity<br>";
print "Tickets = $total";
print "</body></html>";
}
else {
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Add Tickets</title></head>
<form method="post" action="addons/tournament/input.php">
<input type="hidden" name="id" id="id" value="null">
<?php echo border('syellow','start','Add Tickets'); ?>
<table>
<tr><td>Name</td>
<td><input type="text" name="name" id="name"></td>
</tr>
<td>Item</td>
<td><select name="item" id="item">
<option>Dreamfoil</option>
<option>Icecap</option>
<option>Gromsblood</option>
<option>Black Lotus</option>
<option>Stonescale Eel</option>
<option>Mountain Silversage</option>
<option>Golden Sansam</option>
<option>Flask of the Titans</option>
<option>Flask of Supreme Power</option>
</select>
X <input type="text" name="quantity" id="quantity" size="5" />
</td>
</tr>
<tr><td colspan="2">
<p>
<input name="formsubmit" id="formsubmit" type="submit" value="Add items">
</td>
</tr>
</table>
</form>
<?php echo border('syellow','stop'); ?>
</html>
<?php
} 
?>