All pastes #805389 Raw Edit

Anonymous

public php v1 · immutable
·published 2007-12-04 09:27 UTC
rendered paste body
<?php require('config.php'); require('head.php'); require('nav.php'); ?><div id="title"><h2>Purchase Workers</h2></div><div id="content"><form method="post" action="getproduce.php?type=work&id=1"><table border="2" cellpadding="5" align="center" style="border-collapse:collapse;"><tr><td>Worker Type</td><td>Price</td><td>Quanity</td></tr><tr><td>Miners</td><td>200 Gold each</td><td><input type="text" name="mine" onkeypress="return onlyNumbers();"></td></tr><tr><td>Smithers</td><td>1000 Gold each</td><td><input type="text" name="smith" onkeypress="return onlyNumbers();"></td></tr><tr><td>Woodcutters</td><td>400 Gold each</td><td><input type="text" name="wood" onkeypress="return onlyNumbers();"></td></tr><tr><td>Farmers</td><td>400 Gold each</td><td><input type="text" name="farm" onkeypress="return oN();"></td></tr><tr><td align="right" colspan="3"><input type="hidden" name="i"><input type="submit" value="Purchase"></td></tr></table></form><center><?phpif(isset($_POST['i'])) {	$gold = valgold($_SESSION['username']);	if(is_int($_POST['mine'])){		$ms = $_POST['mine'];		$m = $ms *= 200;	} else {		//echo "The value you entered for miners wasn't a valid number!<br />";	}	if(is_int($_POST['smith'])){		$ss = $_POST['smith'];		$s = $ss *= 1000;	} else {		//echo "The value you entered for smithers wasn't a valid number!<br />";	}	if(is_int($_POST['wood'])){		$ws = $_POST['wood'];		$w = $ws *= 400;	} else {		//echo "The value you entered for woodcutters wasn't a valid number!<br />";	}	if(is_int($_POST['farm'])){		$fs = $_POST['farm'];		$f = $fs *= 400;	} else {		//echo "The value you entered for farmers wasn't a valid number!<br />";	}	$t = $m + $s + $w + $f;	echo $t;	if ($t >= $gold){		echo $t;	}}?></center></div><?php require('foot.php'); ?>