Jump to content
MakeWebGames

boionfire81

Members
  • Posts

    532
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by boionfire81

  1. yeah, it's in the link structure.   {$i['inv_id']}   produces the inventory item id. Not the general item id. But, on submit it echos invalid use, maybe because it needs to go to backpack.php afterwards instead of reloading the same page?
  2. So I'm just curious what exactly is the difference with these? I've heard echo is faster, but is that all? And does it matter if you use a single quote vs a double quote, or is that again just a speed thing?
  3. So I'm working on a backpack system. The idea is members will buy more space for their backpack with crystals (or my case credits). And when traveling they will only be able to access the items they have in their backpack. But getting the items transferred to the backpack is an issue. Here's the form that I have for the transfer   <?php require_once('globals.php'); global $db, $userid, $ir; $_GET['ID'] = (isset($_GET['ID']) && is_numeric($_GET['ID'])) ? abs(intval($_GET['ID'])) : ''; $_GET['user'] = (isset($_GET['user']) && is_numeric($_GET['user'])) ? abs(intval($_GET['user'])) : ''; $_POST['qty'] = (isset($_POST['qty']) && is_numeric($_POST['qty'])) ? abs(intval($_POST['qty'])) : ''; if (!empty($_POST['qty']) && !empty($_GET['user'])) { $id = $db->query( "SELECT `inv_qty`, `inv_itemid`, `itmname`, `itmid` FROM `inventory` AS `iv` INNER JOIN `backpack` AS `it` ON `iv`.`inv_itemid` = `it`.`itmid` WHERE `iv`.`inv_id` = {$_GET['ID']} AND iv.`inv_userid` = {$_GET['user']} LIMIT 1"); if ($db->num_rows($id) == 0) { echo 'Invalid item ID'; } else { $r = $db->fetch_row($id); $space = ($ir['maxbackpack'] - $ir['backpack']); $m = $db->query( "SELECT `lastip`,`username` FROM `users` WHERE `userid` = {$_POST['user']} LIMIT 1"); if (!isset($_POST['verf']) || !verify_csrf_code("senditem_{$_GET['ID']}", stripslashes($_POST['verf']))) { echo '<h3>Error</h3><hr /> This transaction has been blocked for your security.<br /> Please send items quickly after you open the form - do not leave it open in tabs.<br /> > <a href="itemsend.php?ID=' . $_GET['ID'] . '">Try Again</a>'; die($h->endpage()); } else if ($_POST['qty'] > $r['inv_qty']) { echo 'You are trying to pack more than you have!'; } else if ($_POST['qty'] > $space) { echo 'You do not have that much room in your backpack'; } else { $rm = $db->fetch_row($m); item_remove($userid, $r['inv_itemid'], $_POST['qty']); $db->query("INSERT INTO `backpack`(`inv_id`, `inv_itemid`, `inv_userid`, `inv_qty`, `inv_lent`, `equip_helmet`, `equip_boots`, `equip_amulet`, `equip_braclet`, `equip_ring`, `equip_special`) VALUES ('',{$_POST['itemid']},{$_POST['userid']},{$_POST['qty']},'','','','','','','')"); echo 'You packed ' . $_POST['qty'] . ' ' . $r['itmname'] . '(s)'; } $db->free_result($m); } $db->free_result($id); } else if (!empty($_GET['ID'])) { $id = $db->query( "SELECT `inv_qty`, `itmname` FROM `inventory` iv INNER JOIN `items` AS `it` ON `iv`.`inv_itemid` = `it`.`itmid` WHERE `iv`.`inv_id` = {$_GET['ID']} AND `iv`.`inv_userid` = $userid LIMIT 1"); if ($db->num_rows($id) == 0) { echo 'Invalid item ID'; } else { $r = $db->fetch_row($id); $code = request_csrf_code("senditem_{$_GET['ID']}"); $space = ($ir['maxbackpack'] - $ir['backpack']); echo " <b>Enter how many {$r['itmname']} you want to pack. You have {$r['inv_qty']} and $space spaces available.</b> <br /> <form action='packit.php' method='post'> Quantity: <input type='text' name='qty' value='' /> <br /> <input type='hidden' name='userid' value='{$_GET['user']}' /> <input type='hidden' name='ID' value='{$_GET['ID']}'> <input type='hidden' name='verf' value='{$code}' /> <input type='submit' value='Pack' /> </form> "; } $db->free_result($id); } else { echo 'Invalid use of file.'; } $h->endpage();   with the inventory page having this link   <a href='packit.php?user={$ir['userid']}&ID={$i['inv_id']}' class='button'>Pack</a>   but every submit is a invalid use. btw this is my code, mixed with a multitracker, and the itemsend. Thus the reason, I'm confused here.
  4. Well the money & crystals are set to 0 and it would only be items. But the if empty clause is there to allow that.
  5. For some reason it keeps validating as incorrect format after I create a new crime   function new_crime_submit() { global $c, $userid, $db, $h; $_POST['name'] = (isset($_POST['name']) && preg_match( "/^[a-z0-9_]+([\\s]{1}[a-z0-9_]|[a-z0-9_])*$/i", $_POST['name'])) ? $db->escape(strip_tags(stripslashes($_POST['name']))) : ''; $_POST['brave'] = (isset($_POST['brave']) && is_numeric($_POST['brave'])) ? abs(intval($_POST['brave'])) : ''; $_POST['percform'] = (isset($_POST['percform'])) ? $db->escape(strip_tags(stripslashes($_POST['percform']))) : ''; $_POST['money'] = (isset($_POST['money']) && is_numeric($_POST['money'])) ? abs(intval($_POST['money'])) : ''; $_POST['crys'] = (isset($_POST['crys']) && is_numeric($_POST['crys'])) ? abs(intval($_POST['crys'])) : ''; $_POST['item'] = (isset($_POST['item']) && is_numeric($_POST['item'])) ? abs(intval($_POST['item'])) : 0; $_POST['group'] = (isset($_POST['group']) && is_numeric($_POST['group'])) ? abs(intval($_POST['group'])) : ''; $_POST['itext'] = (isset($_POST['itext'])) ? $db->escape(strip_tags(stripslashes($_POST['itext']))) : ''; $_POST['stext'] = (isset($_POST['stext'])) ? $db->escape(strip_tags(stripslashes($_POST['stext']))) : ''; $_POST['ftext'] = (isset($_POST['ftext'])) ? $db->escape(strip_tags(stripslashes($_POST['ftext']))) : ''; $_POST['jtext'] = (isset($_POST['jtext'])) ? $db->escape(strip_tags(stripslashes($_POST['jtext']))) : ''; $_POST['htext'] = (isset($_POST['htext'])) ? $db->escape(strip_tags(stripslashes($_POST['htext']))) : ''; $_POST['jailtime'] = (isset($_POST['jailtime']) && is_numeric($_POST['jailtime'])) ? abs(intval($_POST['jailtime'])) : ''; $_POST['hosptime'] = (isset($_POST['hosptime']) && is_numeric($_POST['hosptime'])) ? abs(intval($_POST['hosptime'])) : ''; $_POST['jailreason'] = (isset($_POST['jailreason']) && preg_match( "/^[a-z0-9_]+([\\s]{1}[a-z0-9_]|[a-z0-9_])*$/i", $_POST['jailreason'])) ? $db->escape( strip_tags(stripslashes($_POST['jailreason']))) : ''; $_POST['hospreason'] = (isset($_POST['hospreason']) && preg_match( "/^[a-z0-9_]+([\\s]{1}[a-z0-9_]|[a-z0-9_])*$/i", $_POST['hospreason'])) ? $db->escape( strip_tags(stripslashes($_POST['hospreason']))) : ''; $_POST['crimexp'] = (isset($_POST['crimexp']) && is_numeric($_POST['crimexp'])) ? abs(intval($_POST['crimexp'])) : ''; if (empty($_POST['name']) || empty($_POST['brave']) || empty($_POST['percform']) || (empty($_POST['money']) && !is_numeric($_POST['money'])) ||(empty($_POST['crys']) && !is_numeric($_POST['crys'])) || empty($_POST['group']) || empty($_POST['itext']) || empty($_POST['stext']) || empty($_POST['ftext']) || empty($_POST['jtext']) || empty($_POST['htext']) || (empty($_POST['jailtime']) && !is_numeric($_POST['jailtime'])) || (empty($_POST['hosptime']) && !is_numeric($_POST['hosptime'])) || empty($_POST['jailreason']) || empty($_POST['hospreason']) || empty($_POST['crimexp'])) { echo 'One or more of the inputs seems to of the wrong format, please go back and try again.<br /> > <a href="staff_crimes.php?action=newcrime">Go back</a>'; die($h->endpage()); } staff_csrf_stdverify('staff_newcrime', 'staff_crimes.php?action=newcrime'); if (!empty($_POST['item'])) { $qi = $db->query( 'SELECT COUNT(`itmid`) FROM `items` WHERE `itmid` = ' . $_POST['item']); $exist_check = $db->fetch_single($qi); $db->free_result($qi); if ($exist_check == 0) { echo 'Item you selected doesn\'t seem to exist.<br /> > <a href="staff_crimes.php?action=newcrime">Go back</a>'; die($h->endpage()); } } $db->query("INSERT INTO crimes (crimeNAME, crimeBRAVE, crimePERCFORM, crimeSUCCESSMUNY, crimeSUCCESSCRYS, crimeSUCCESSITEM, crimeGROUP, crimeITEXT, crimeSTEXT, crimeFTEXT, crimeJTEXT, crimeHTEXT, crimeJAILTIME, crimeHOSPTIME, crimeJREASON, crime HREASON, crimeXP) VALUES( '{$_POST['name']}', '{$_POST['brave']}', '{$_POST['percform']}', '{$_POST['money']}', '{$_POST['crys']}', '{$_POST['item']}', '{$_POST['group']}', '{$_POST['itext']}', '{$_POST['stext']}', '{$_POST['ftext']}', '{$_POST['jtext']}', '{$_POST['htext']}','{$_POST['jailtime']}', '{$_POST['hosptime']}','{$_POST['jailreason']}', '{$_POST['hospreason']}', '{$_POST['crimexp']}',)"); echo 'Crime (' . $_POST['name'] . ') created.<br /> > <a href="staff.php">Goto Main</a>'; stafflog_add('Created crime ' . $_POST['name']); }
  6. boionfire81

    DB query

    so fetch_row instead of query?
  7. Yeah. I was trying to think how to solve that. I can check the cash, but no idea how to properly add that. And I'll add the items to a variable. Just had to update to use the cron. Without steps you can just keep going and time added has no effect. So when time is added it simply blocks you from exploring anymore that day. So a simple roll of the dice.
  8. boionfire81

    DB query

    Trying my hand at a note pad of sorts. I have a table setup called notepad with 3 columns, myid, yourid, note. The idea is to select the contents of the note column and display it where the userid's match. I came up with this $myid = ($ir['userid']); $yourid = ($r['userid']); $note = $db->query("SELECT `note` FROM `notepad` WHERE `myid`={$ir['userid']} AND `yourid`={$r['userid']}"); <textarea rows=7 cols=40 name='note'>{$note}</textarea>   BUT the error is A critical error has occurred, and page execution has stopped. Below are the details: PHP Recoverable Error: Object of class mysqli_result could not be converted to string (4096) mccodes v2.0.5 btw
  9. So, I found this mod at http://makewebgames.io/forum/ga...spital-explore and I decided to update it a bit. Instead of using energy and restricting the amount of attempts, I decided to use stamina with unlimited attempts (as there are no medical items for healing, if you get hurt your hurt! or have insurance for healing and/or credits). I also added the ability to find items with a random amount, and a bribe feature. So here it is. Real simple. 1 file. 1 sql. 1 line for cron_day. Replace the numbers 87 & 88 with your item id's.   <?php /****************************************/ /************ Created By Seker *************/ /********** Bugs Fixed By mixmaster *********/ /********** Remix By Boi ***********/ /****************************************/ require_once('globals.php'); global $db, $ir, $c, $userid, $h; $db->query("SELECT hsteps FROM users WHERE userid=$userid"); if (!$ir['hospital']) { echo " You are not in the hospital! <a href='index.php' class='button'>Exit</a>"; exit($h->endpage()); } if ($ir['jail']) { echo " You cannot be here while in jail! <a href='jail.php' class='button'>Home</a>"; exit($h->endpage()); } if ($ir['brave'] < 1) { echo " You do not have enough stamina to explore the hospital! <a href='digits.php' class='button>Refill</a>"; exit($h->endpage()); } if ($ir['hsteps'] > 0) { echo "The doctors remember you! They have strapped you to the bed. Best to give them time to forget. Or drug them up."; exit($h->endpage()); } $_GET['action'] = isset($_GET['action']) && ctype_alpha($_GET['action']) ? $_GET['action'] : null; $_GET['action'] = $db->escape( htmlentities(stripslashes($_GET['action']), ENT_QUOTES, 'ISO-8859-1')); switch ($_GET['action']) { case 'explore': do_explore(); break; default: index(); break; } function index () { global $db, $ir, $c, $userid, $h; echo " <table width='70%' border='1'> <tr> <td align='center'> <b><u>Explore The Hospital</u></b> </td> </tr> <tr> <td align='center'> Explore the hospital! You never know what you'll find! </td> </tr> <tr> <td align='center'> It will cost you 1 Staminia! </td> </tr> <tr> <td align='center'> You can earn your release, or you can end up spending even longer in the hospital, so be careful! </td> </tr> </table> <table width='70%' border='1'> <tr> <td align='center'>"; if ($ir['brave'] > 0) { echo " <a href='hospexplore.php?action=explore' class='button'>Explore</a> </td> </tr> </table>"; } else { echo " You need to rest and get your stamina back before you can explore! <a href='hospital.php' class='button'>Back</a> </td> </tr> </table>"; } } function do_explore() { global $ir, $h, $c, $userid, $db; if (!$ir['hospital']) { echo " You are not in the hospital! <a href='index.php' class='button'>Exit</a>"; exit($h->endpage()); } if ($ir['jail']) { echo " You cannot be here while in jail! <a href='index.php' class='button'>Home</a>"; exit($h->endpage()); } if ($ir['brave'] < 1) { echo " You do not have enough stamina to explore the hospital! <a href='digits.php' class='button'>Refill</a>"; exit($h->endpage()); } $result = rand(1,6); $db->query("UPDATE users SET brave=brave-1 WHERE userid=$userid"); if ($result == 1) { $db->query("UPDATE users SET hospital=hospital+5,hospreason=Got a boo boo,health=1,hstep=1 WHERE userid=$userid"); echo " While wandering through the hospital a guard catches you. Thinking you are an escaped psychiatric patient, he tackles you to the floor. You now have another boo-boo to patch up. <a href='hospexplore.php?action=explore' class='button'>Continue Exploring</a> <a href='hospital.php' class='button'>Give Up</a>"; exit($h->endpage()); } else if ($result == 2) { $amnt = rand(1,2); item_add($userid,87,$amnt); echo " You notice a few white pills set aside in an empty patients room. You pocket them an continue on. <a href='hospexplore.php?action=explore' class='button'>Continue Exploring</a> <a href='hospital.php' class='button'>Give Up</a>"; exit($h->endpage()); } else if ($result == 3) { $db->query("UPDATE users SET hospital=0 WHERE userid=$userid"); echo " You stumbled across the back exit! Time to get out of here!<br><center> <a href='index.php' class='button'>Get Me Out Of Here!</a></center>"; exit($h->endpage()); } else if ($result == 4) { $amnt = rand(1,4); item_add($userid,88,$amnt); echo " You notice a white door with a label that say 'Med Lab'. You also notice there are a lot of security cameras. You run in grab the first pills you can find and dash out!<br><center> <a href='hospexplore.php?action=explore' class='button'>Continue Exploring</a> <a href='hospital.php' class='button'>Give Up</a></center>"; exit($h->endpage()); } else if ($result == 5) { $amnt = rand(1,20); $db->query("UPDATE users SET hospital=hospital+$amnt,hospreason=Stabbed by a lunatic,health=1 WHERE userid=$userid"); echo " Sometimes wandering aimlessly is a bad idea. While walking through the halls, you all of a sudden are dropped go the floor. Something or someone must have knocked you down from behind. You see a patient running away. Feeling cold, slightly wet, and a stabbing pain. You notice blood beside you. You pass back out only to wake up with another injury. <a href='hospexplore.php?action=explore' class='button'>Continue Exploring</a> <a href='hospital.php' class='button'>Give Up</a>"; exit($h->endpage()); } else if ($result == 6) { $amnt = rand(10,150); $db->query("UPDATE users SET hospital=0,money=money-$amnt WHERE userid=$userid"); echo " Ah a training room! You know you can bribe one of the noob doctors to write up your release. You walk up to one of the med students and try to bribe them to let you out. They agree but says it will cost you \$ $amnt. You agree and they write your release. <a href='hospital.php' class='button'>Exit</a>"; exit($h->endpage()); } } $h->endpage();   ALTER TABLE `users` ADD `hsteps` INT( 11 ) NOT NULL DEFAULT 0;   Add to cron_day   $db->query("UPDATE `users` SET `hsteps`=0");   Feedback is welcome. But just remember I basically read my first line of php only a month ago.
  10. This is what I have   <?php include "globals.php"; echo "<h3>Edit Account</h3>"; if(!empty($_POST['username']) && !empty($_POST['email'])) { foreach($_POST as $k => $v) { $v=trim($v); } $username=$db->escape($_POST['username']); $email=$db->escape($_POST['email']); $gender=!empty($_POST['gender']) ? $db->escape($_POST['gender']) : ''; $forum_sig=!empty($_POST['forums_sig']) ? $db->escape($_POST['forums_sig']) : ''; $prof_sig=!empty($_POST['signature']) ? $db->escape($_POST['signature']) : ''; $unqr=$db->query("SELECT `userid` FROM `users` WHERE `username`='{$username}'"); $emqr=$db->query("SELECT `userid` FROM `users` WHERE `email`='{$email}'"); $error=false; if($db->num_rows($unqr) && $db->escape($ir['username']) !=$_POST['username']) { $error=true; echo "Username in use.<br />"; } if($db->num_rows($emqr) && $db->escape($ir['email']) !=$_POST['email']) { $error=true; echo "Email in use.<br />"; } if($error==false) { $db->query("UPDATE `users` SET `username`='{$username}',`email`='{$email}',`gender`='{$gender}',`display_pic`='{$display_pic}',`forums_signature`='{$forum_sig}',`signature`='{$signature}' WHERE `userid`='{$ir['userid']}'"); } if((!empty($_POST['newpw']) || !empty($_POST['newpw2'])) && $_POST['newpw'] !=$_POST['newpw2']) { echo "New passwords do not match."; } elseif(!empty($_POST['newpw']) && !empty($_POST['newpw2']) && $_POST['newpw']==$_POST['newpw2']) { $pass=md5($_POST['newpw']); $db->query("UPDATE `users` SET `userpass`='{$pass}' WHERE `userid`='{$ir['userid']}'"); } } else { echo '<form method="post" class="input" enctype="multipart/form-data"><table width="95%"> <tr><td>Username:</td><td><input type="text" name="username" value="'.htmlspecialchars($ir['username']).'" class="inputs"/></td></tr> <tr><td>Email:</td><td><input type="text" name="email" value="'.htmlspecialchars($ir['email']).'" class="inputs"/></td></tr> <tr><td>Password:</td><td><input type="password" name="newpw1" class="inputs"/></td></tr> <tr><td>Confirm Password:</td><td><input type="password" name="newpw2" class="inputs"/></td></tr> <tr><td>Gender:</td><td><select name="gender" class="inputs">'; $gens=array('Male','Female'); foreach($gens as $k => $v) { if($ir['gender']==$v) { echo '<option selected="selected">'.$v.'</option>'; } else { echo '<option>'.$v.'</option>'; } } echo '</select> </td></tr> <tr><td>Display Pic:</td><td><input type="file" name="display_pic" value="" class="inputs"/></td></tr> <tr><th style="text-align: left;">Forum Signature</th> <td><textarea rows="4" cols="100" name="forums_sig">'.htmlspecialchars($ir['forums_signature']).'</textarea></td></tr> <tr><th style="text-align: left;">Profile Signature</th> <td><textarea rows="6" cols="100" name="signature">'.htmlspecialchars($ir['signature']).'</textarea></td></tr> <tr><td></td><td><input type="submit" value="Save" class="formbutton"/></td></tr> </table></form>'; } //Edit below for max fb size of the pic $maxsize = 1000000; /*Basic security procedures*/ if(!$_SERVER['REQUEST_METHOD'] == "POST" || !isset($_SERVER['HTTP_USER_AGENT'])){ echo 'Hack Attempt!'; $h->endpage(); exit; } $headerinject = array("Content-Type:", "MIME-Version:", "Content-Transfer-Encoding:", "bcc:", "cc:"); foreach($_POST as $k => $v){ foreach($headerinject as $v2){ if(strpos($v, $v2) !== false){ logBadRequest(); header("HTTP/1.0 403 Forbidden"); exit; } } } /*What extensions can be used?*/ $valid = array('image/gif', 'image/png', 'image/pjpeg','image/jpeg', 'image/jpg'); /*If the extension isnt allowed...*/ if(!in_array($_FILES['imagefile']['type'], $valid)) { $type = strrchr($_FILES['imagefile']['display_pic'], '.'); echo 'This file type '.$type.' is not allowed. <br><a href="account.php" class="button">Try Again</a>'; $h->endpage(); exit; } /*Check image size*/ if ($_FILES['imagefile']['size'] > $maxsize) { echo 'Image to large <br><a href="account.php" class="button">Try Again</a>'; $h->endpage(); exit; } $check = ''.$_FILES['imagefile']['tmp_name'].''; /*Check for .exe files*/ if (is_executable($check) || !is_file($check)) { echo 'The file '.$_FILES['imagefile']['name'].' seems to be harmful to the server <br><a href="account.php" class="button">Try Again</a>'; @unlink($check); $h->endpage(); exit; } /*Now to create the correct image using php*/ if ($_FILES['imagefile']['type']=="image/jpeg") { $create = @ImageCreateFromJPEG(''.$_FILES['imagefile']['tmp_name'].''); $image = @Imagejpeg($create, 'profilepics/'.$_FILES['imagefile']['name'].''); } if ($_FILES['imagefile']['type']=="image/png") { $create = @ImageCreateFromPNG(''.$_FILES['imagefile']['tmp_name'].''); $image = @Imagepng($create, 'profilepics/'.$_FILES['imagefile']['name'].''); } if ($_FILES['imagefile']['type']=="image/jpg") { $create = @ImageCreateFromJPEG(''.$_FILES['imagefile']['tmp_name'].''); $image = @Imagejpeg($create, 'profilepics/'.$_FILES['imagefile']['name'].''); } if ($_FILES['imagefile']['type']=="image/gif") { $create = @ImageCreateFromGIF(''.$_FILES['imagefile']['tmp_name'].''); $image = @Imagegif($create, 'profilepics/'.$_FILES['imagefile']['name'].''); } if ($_FILES['imagefile']['type']=="image/pjpeg") { $create = @ImageCreateFromJPEG(''.$_FILES['imagefile']['tmp_name'].''); $image = @Imagejpeg($create, 'profilepics/'.$_FILES['imagefile']['name'].''); } /*Destroy the php image*/ @unlink(''.$_FILES['imagefile']['tmp_name'].''); @ImageDestroy($create); /*If php could not create the image*/ if (!$create) { echo 'The image you are trying to upload seems to be corrupt please try again! Back'; $h->endpage(); exit; } $path = 'profilepics/'; $pic = $_FILES['imagefile']['name']; $picture = $path.$pic; $oldpic = $ir['display_pic']; /*Check to see if its already uploaded*/ if ($picture == $oldpic) { echo ' Image already uploaded!Back'; $h->endpage(); exit; } /*Delete previous image to save space*/ $delete = ($oldpic); if ($delete) { echo 'Previous image deleted from system... '; } if (!$delete) { echo 'No Previous image to be deleted... '; } $dataa = $_FILES['imagefile']['size']; $datab = $_FILES['imagefile']['type']; $datad = $_FILES['imagefile']['name']; /*Information for user*/ echo 'Old Image Location: '.$oldpic.' New Image Location: '.$picture.' Image Uploaded <u>Info:</u> Image Name: '.$datad.' Image Size: '.$dataa.' bytes Type: '.$datab.' Back'; /*Check DB*/ $check = $db->query( sprintf("SELECT COUNT(*) as cnt FROM `users` WHERE `display_pic` = '%s'", $db->escape($picture))); $checks = $db->fetch_row($check); if ($checks['cnt'] > 0) { echo 'Please use another image name Back'; $h->endpage(); exit; } $h->endpage(); exit(); ?>   all it ever says is invalid image type.
  11. I avoid Skype as much as possible. -.- Right now there error is A critical error has occurred, and page execution has stopped. Below are the details: PHP Warning: Invalid argument supplied for foreach() (2) line 97     if(isset($_POST['submit'])) { foreach($_POST['set'] as $name => $value) { $db->query("UPDATE settings SET conf_value = '".mysql_real_escape_string($value)."' WHERE conf_name = '".$name."'"); } $set=array(); $settq=$db->query("SELECT * FROM settings"); while($r=$db->fetch_row($settq)) { $set[$r['conf_name']]=$r['conf_value']; } $saved = true; }
  12. Seems to be working?? I can't really tell due to the what seems like 20 undefined offset???   here's the line if($equip[$ir['equip_helmet']]['itmid'])   A non-critical error has occurred. Page execution will continue. Below are the details: PHP Notice: Undefined offset: 0 (8) line 13
  13. So here's the thing. I'm taking two mods http://makewebgames.io/forum/game-engines/mccode-development-support/free-modifications/16045-user-settings-mod & http://makewebgames.io/forum/game-engines/mccode-development-support/free-modifications/2025-mccode-v2-profile-image-uploader I've got the upload working perfect on it's own page, as well as the one account page. BUT how can I change the display picture from text to upload?  
  14. Still not printing anything....   function index() { global $ir,$userid,$h, $db; print" <table border=1 width=85%> <tr> <th colspan=4><center>Your Items Currently Being Created <a href=workshop.php?action=create class='button'>Create New</a></center></th> </tr> <tr> <th width=30%>Item Name</th> <th width=30%>Your Cost(s)</th> <th width=20%>% Complete</th> <th width=20%>---</th> </tr>"; $blah=$db->query("SELECT * FROM itemscreated WHERE iUSER=$userid ORDER BY iID ASC"); if($db->num_rows($blah) == 0) { print" <tr> <td colspan=4><center>You are currently not creating any items!</center></td> </tr>"; } else { while($basic=$db->fetch_row($blah)) { $lsso=$db->query("SELECT * FROM workshop WHERE wITEM={$basic['iITEM']}"); $workshop=$db->fetch_row($lsso); $percent=round($basic['iWORK']/$workshop['wWORK']*100,2); $lso=$db->query("SELECT * FROM items WHERE itmid={$basic['iITEM']}"); $item=$db->fetch_row($lso); if($workshop['wCRYSTALS'] > 0){ $crystals="<br>{$workshop['wCRYSTALS']} Crystals";}else{ $crystals="";} if($workshop['wCOST'] > 0){ $cost="<br>\${$workshop['wCOST']}";}else{ $cost="";} print" <tr> <td>{$item['itmname']} [<A href=workshop.php?action=cancel&ID={$basic['iID']}><font color=red size=1>X</font></a>]</td> <td><center>$cost$crystals</center> <ul>"; $lsd=$db->query("SELECT * FROM itemsneeded WHERE nID={$basic['iITEM']}"); while($needed=$db->fetch_row($lsd)) { $lso=$db->query("SELECT * FROM items WHERE itmid={$needed['nITEM']}"); $item=$db->fetch_row($lso); print"<li><a href=iteminfo.php?ID={$item['itmid']}><font size=1>{$item['itmname']}</font></a></li>"; } $time=time(); $hmmm=$time-$basic['iLASTWORK']; $seconds=$workshop['wTIME']*60; if($hmmm > $seconds) { $workin="<a href=workshop.php?action=work&ID={$basic['iID']}><font color=green>Work On Item</font></a>"; } else { $just=ceil(($seconds-$hmmm)/60); $werd=""; if($just != 1) { $werd="s"; } $workin="<font color=red>$just Minute$werd</font>"; } print"</ul></td> <td><center>$percent%</center></td> <td><center>$workin</center></td> </tr>"; } } echo " </tr></table>"; }
  15. so change $db->query to mysqli_query??? or just change the   if(mysqli_num_rows($blah) == 0)   And, this is my project for the day :)  
  16. I don't have skype. Just Google hangouts. I'll pm you. [uSER=52003]Dave Macaulay[/uSER]
  17. Yeah, I'm searching for something kinda like this. I want a few shops to be located in all cities, and the rest be city specific (standardized version). Not sure if that is possible though? Might be able to get away with a simple staff_shops edit for a check mark for all cities and a sql update??
  18. Ok, links are working fine. I have   if (in_array($ir['location'], array(105, 103, 90, 182, 39, 160, 40, 218, 131, 101))) { echo "   But other pages that have multi functions are now confusing me. The above line again would work, but does it really need repeated EVERY function? That is going to really slow down the speed after awhile.
  19. Anyone have any idea as to why cronus workshop does not return any items listed as able to be crafted dispite them being added in the staff panel?   $blah=$db->query("SELECT * FROM itemscreated WHERE iUSER=$userid ORDER BY iID ASC"); if(mysqli_num_rows($blah) == 0) while($basic=$db->fetch_row($blah)) { $lsso=$db->query("SELECT * FROM workshop WHERE wITEM={$basic['iITEM']}"); $workshop=$db->fetch_row($lsso); $percent=round($basic['iWORK']/$workshop['wWORK']*100,2); $lso=$db->query("SELECT * FROM items WHERE itmid={$basic['iITEM']}"); $item=$db->fetch_row($lso); if($workshop['wCRYSTALS'] > 0){ $crystals="<br>{$workshop['wCRYSTALS']} Crystals";}else{ $crystals="";} if($workshop['wCOST'] > 0){ $cost="<br>\${$workshop['wCOST']}";}else{ $cost="";} $lsd=$db->query("SELECT * FROM itemsneeded WHERE nID={$basic['iITEM']}"); while($needed=$db->fetch_row($lsd)) { $lso=$db->query("SELECT * FROM items WHERE itmid={$needed['nITEM']}"); $item=$db->fetch_row($lso); print"<li><a href=iteminfo.php?ID={$item['itmid']}><font size=1>{$item['itmname']}</font></a></li>"; } $time=time(); $hmmm=$time-$basic['iLASTWORK']; $seconds=$workshop['wTIME']*60; if($hmmm > $seconds) { $workin="<a href=workshop.php?action=work&ID={$basic['iID']}><font color=green>Work On Item</font></a>"; }
  20. boionfire81

    Get action

    So in most cases this has been my default/go to for defining a switch get action   $_GET['action'] = isset($_GET['action']) && ctype_alpha($_GET['action']) ? $_GET['action'] : null;   But lately all that line has been doing is rendering an action unusable. As defining thing is my worst area, I think, can anyone help clue me in as to in which cases that line would not work.
  21. >.< we already talked about that earlier in this thread
  22. Fatal error: Call to undefined function class_dropdown() in /home/tcxtra5/public_html/register.php on line 297 is with the first With the second actually a white page and Parse error: syntax error, unexpected 'print' (T_PRINT)
  23. so replace that with include ('global_func.php'); ?
  24. After [uSER=65530]Coly010[/uSER] post I realized I must of missed something. But now I see why. Bro, defines are seriously over my head. I've already started talking with [uSER=70347]NonStopCoding[/uSER] to pay him just to fix the 19 undefined errors I have on my site currently. Thankfully he fixed 2 of them already. ok so what am I do with $allowed? gangs.php? .php? Gangs? My guess would be the first. Then the Script name what replaces that??? I really do feel so stupid talking here sometimes. I try to let you know, I'm "self" taught from this forum working, but yet I feel like if I don't know what you guys are referring to, then why should I bother? I bother cause I want to learn and working to make a game was a fun idea to me. But I really do feel stupid when I have to reply to ask what to me does seem like basic details.
  25. no, not host. was just updating switching the macro/global worked dude said no errors there now.
×
×
  • Create New...