All pastes #94445 Raw Edit

Someone

public text v1 · immutable
#94445 ·published 2006-07-21 08:33 UTC
rendered paste body
<?php
include('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'
);

$name = mysql_real_escape_string($_POST['name']);
$item = mysql_real_escape_string($_POST['item']);
$quantity = mysql_real_escape_string($_POST['quantity']);
$total = $prices[$_POST['item']] * $_POST['quantity'];
$sqlquery = "INSERT INTO tournament VALUES('$id','$name','$item','$quantity','$total')";

$results = mysql_query($sqlquery)or die(mysql_error());

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" value="null">
<?php echo border('syellow','start','Add Tickets'); ?>
<table>
<tr><td>Name</td>
<td><input type="text" name="name"></td>
</tr>
<td>Item</td>
<td><select name="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" size="5" />
</td>
</tr>
<tr><td colspan="2">
<p>
<input name="formsubmit" id="formsubmit" type="submit" value="Add items">
</td>
</tr>
</table>
<?php echo border('syellow','stop','Entries'); ?>
</form>
</html>
<?php
}
?>