Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(isset($_POST['submit'])){
- $error = array();
- echo '1';
- $resources = array("clay","brick","ore","tree","gold","oil","oven","iron","wood","vest","gas","pump","screw","shovel","engine","plastic","drill","saw","machine","gun","chips","phone","cam","alarm","comp","diamond","powder","bomb","glass");
- echo '2';
- foreach($resources as $rsc_raw){
- echo '3';
- $rsc_p = 'rsc_'.$rsc_raw;
- if(isset($_POST[$rsc_p]) && !empty($_POST[$rsc_p])){
- echo '4';
- if(is_numeric($_POST[$rsc_p])){
- echo '5';
- $rsc = $_POST[$rsc_p];
- $rsc_add = mysql_query("UPDATE cost SET ".$rsc_raw."='$rsc' WHERE user_id='$_SESSION[user_id]' ") or die(mysql_error());
- echo '6';
- }else{
- echo '7';
- $error[] = 'Please post a numeric value for .'.$rsc_raw;
- header('Location:prompt.php?x=5');
- }
- }
- }
- if(isset($error) && !empty($error)){
- $error_message = '<span class="error">';
- foreach($error as $key => $values){
- $error_message.= "$values";
- }
- $error_message.="</span><br/><br/>";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement