Jump to content

2DaysAway

Members
  • Posts

    49
  • Joined

  • Last visited

    Never

About 2DaysAway

  • Birthday 02/29/1972

Contact Methods

  • MSN
    jfunk1@cinci.rr.com
  • Website URL
    http://www.cartelz.com

Profile Information

  • Gender
    Male
  • Location
    Cincinnati, Ohio

2DaysAway's Achievements

Member

Member (2/5)

0

Reputation

  1. Error: Warning: getimagesize(HighRollerz.gif) [function.getimagesize]: failed to open stream: No such file or directory in /home/thumpi5/public_html/crew.php on line 111 Here is the script: if ($fileupload) { $arr_allow_ex=array("gif","jpg","png"); $uploadpath=$dir."/"; $source=$_FILES[fileupload][tmp_name]; $fileupload_name=$_FILES[fileupload][name]; $weight=$_FILES[fileupload][size]; $imagehw = GetImageSize($fileupload_name); $imagewidth = $imagehw[0]; $imageheight = $imagehw[1]; if (($crew["founder"] != $user["pimp"]) && ($crew["cofounder"] != $user["pimp"])) { $message='you are not the founder of this crew.'; } elseif ($imagewidth >= 33){$message="image width to big ($imagewidth pixels)";} elseif ($imageheight >= 33){$message="image height to big ($imageheight pixels)";} else{ for($i=0;$i<count($arr_allow_ex);$i++) { if(getlast($fileupload_name)!=$arr_allow_ex[$i]) $test.="~~"; } $exp=explode("~~",$test); if(strstr($fileupload_name, " ")) {$message='you cannot have spaces in file name.';} elseif(count($exp)==(count($arr_allow_ex)+1)){$message='invalid image type.';} elseif($weight>$wei_fileupload){$message="File is to large (".$wei_fileupload." bytes)";} else{ $fileupload_name="$fileupload_name$time"; $dest = ''; if ( ($source != 'none') && ($source != '' )) { $dest=$uploadpath.$fileupload_name; if ($dest != '') { if (copy($source,$dest)) { $exfile=explode(".",$fileupload_name); $message="icon has been set successfully!"; mysql_query("UPDATE `{$tab[crew]}` SET `icon`='$dir$fileupload_name' WHERE `name`='$crw' AND `rid`='$rid'"); } } } } } } Now, its uploading the file to the database. It worked fine in Php4 but now that its in php5, I'm getting this error, any ideas or help would be appreciated, thank you.
  2. I have an option on my game for a player to add more turns for use. The way I have it set up is after a 48 hour countdown, a link appears, they click the link, they're SUPPOSE to go to another page with a form and an option to select yes or no to verify if they want to add these turns. BUT what happens, they click the link to add the turns and instead of it going to the page, it just runs the script. Here is the script if (($bonustransfer != "no") && ($answer="yes")){ if($time < $pimp[bonusturntime]){ $msg="You have to wait before receiving bonus turns"; } elseif($time < $site[starts]){ $msg="You must wait until this game starts!"; } elseif($bonustransfer > $user[credit]){ $msg="You dont have that many credits!"; } else{ $pimp = mysql_fetch_array(mysql_query("SELECT bonusturnsuses,crewjoindate,crewbonusturns,bonusturns,loyality,crew FROM `{$tab[pimp]}` WHERE `id`='$id' AND `rid`='$rid';"))or die("Error : didnt pull pimps info" . mysql_error()); $user = mysql_fetch_array(mysql_query("SELECT credit FROM `{$tab[user]}` WHERE `id`='$id';"))or die("Error : didnt pull credit count" . mysql_error()); $bonustime=$time+172800;//bonus turns every 48 hours $crewinfo = mysql_fetch_array(mysql_query("SELECT members,totalbtuses FROM `{$tab[crew]}` WHERE `id`='$pimp[crew]' AND `rid`='$rid';"))or die("Error : didnt pull crew info" . mysql_error()); $ct=$crewinfo["members"]; $tcbt=$crewinfo["totalbtuses"]; $cjd=$pimp["crewjoindate"]; $cbt=$pimp["crewbonusturns"]; $btu=$pimp["bonusturnsuses"]; $pcw=$pimp["crew"]; if($pcw<=0){$bt=0;} else{$bt=10;} $enddate=$time; $diff=$enddate-$cjd; // immediately convert to days $temp=$diff/86400; // 60 sec/min*60 min/hr*24 hr/day=86400 sec/day // days $days=floor($temp); $temp=24*($temp-$days); $ply=$pimp["loyality"]; if($pcw<=0){$xbt=0;} else{$xbt=$days*$bt;} if($pcw<=0){$lxbt=0;} else{$lxbt=$bt*$ply;} $bonusturns=$pimp["bonusturns"]+$cbt+$lxbt+$ct+$tcbt; $adminmessage="Auto-Response: you received ". $bonusturns ." bonus turns."; mysql_query("INSERT INTO `{$tab[mail]}` (rid,src,dest,msg,time,inbox) VALUES ('$rid','$adminid','$id','$adminmessage','$time',2);")or die("Error : " . mysql_error("tabmail error")); mysql_query("UPDATE `{$tab[pimp]}` SET `messages`=messages+1 WHERE `id`='$id' AND `rid`='$rid'")or die("Error : did not update message bin" . mysql_error()); mysql_query("UPDATE `{$tab[pimp]}` SET `bonusturnsuses`=$btu+1 WHERE `id`='$id' AND `rid`='$rid'")or die("Error : did not update bonus turn count" . mysql_error()); mysql_query("UPDATE `{$tab[pimp]}` SET `loyalityturns`=$lxbt WHERE `id`='$id' AND `rid`='$rid'")or die("Error : did not update loyality turn count" . mysql_error()); mysql_query("UPDATE `{$tab[pimp]}` SET `turn`=turn+$bonustransfer+$cbt+$lxbt+$ct+$tcbt, `bonusturntime`=$bonustime WHERE `id`='$id' AND `rid`='$rid'")or die("Error : did not give turns" . mysql_error()); mysql_query("UPDATE `{$tab[pimp]}` SET `crewbonusturns`=crewbonusturns+$xbt WHERE `id`='$id' AND `rid`='$rid'")or die("Error : did not give crew bonus turns" . mysql_error()); mysql_query("UPDATE `{$tab[user]}` SET `credit`=credit-$bonustransfer WHERE `id`='$id'")or die("Error :did not deduct credits from account " . mysql_error()); mysql_query("UPDATE `{$tab[crew]}` SET `totalbtuses`=$btu+1 WHERE `id`='$pimp[crew]'")or die("Error :did not update crew bonusturn usest " . mysql_error()); mysql_query("INSERT INTO `{$tab[credits]}` (id,username,action,time,ip) VALUES ('','$un','$adminmessage','$time','$REMOTE_ADDR');")or die ("Did not INSERT info into credit table " .mysql_error ()); header("Location: main.php?rid=$rid"); } } Here is the form <form method="post" action="bonuscredits.php?action=bonustransfer"> <div class="boxdef-hd"> <b>need more turns?</b> <div class="boxdef" align="center"> <table align="center" cellspacing="1" cellpadding="4"> <tr> <td><select name="answer" class="entry"> <option class="entry" value="">select</option> <option class="entry" value="yes">yes</option> <option class="entry" value="no">no</option> </select></td> </tr> <tr> <td><input type="hidden" class="entry" size="5" value="<?=$answer?>" name="bonustransfer"> <input type="submit" class="button" value="transfer"></td> </tr> </table> </div> </div> </form> Can someone please take a look and let me know what I'm doing wrong here. Thank you
  3. the game_html file has another include file for the game_setup and that's where it gets it from. if (!isset($_GET["rid"])) $rid=$play; else $rid=$_GET["rid"];
  4. Here's the scenario: Player clicks link when turns are available <a href="bonuscredits.php?rid=<?=$rid?>"><font size="-2">(add bonus turns)</font</a> Now, it should just take them to the bonuscredits page and then the player has to manually click the submit button to get his/her turns. BUT, what is happening is the player clicks the link for the bonuscredits and the next thing the player knows, he has his turns and never even saw the bonuscredits page. I'll post the code for the bonuscredits page, could someone please take a look and let me know why it's automatically running the script when I thought it should show the form and allow the player to choose.... <?php include("game_html.php"); $game="yes"; mysql_query("UPDATE `{$tab[pimp]}` SET `currently`='adding bonus turns', `online`='$time' WHERE `id`='$id' AND `rid`='$rid'"); $user = mysql_fetch_array(mysql_query("SELECT credit,username FROM `{$tab[user]}` WHERE `id`='$id';")); $un=$user["username"]; $pimp = mysql_fetch_array(mysql_query("SELECT pimp,transfer,bonusturntime,bonusturns,bonusturnsuses FROM `{$tab[pimp]}` WHERE `id`='$id' AND `rid`='$rid';")); $user2 = mysql_fetch_array(mysql_query("SELECT id FROM `{$tab[pimp]}` WHERE `pimp`='$pmp' AND `rid`='$rid';")); $adminid="5"; $bonustransfer=$pimp[bonusturns]; $timeleft=$time-$pimp[bonusturntime]; //add bonus turns if ($bonustransfer){ if($time < $pimp[bonusturntime]){ $msg='You have to wait before receiving bonus turns'; } elseif($time < $site[starts]){ $msg="You must wait until this game starts!"; } elseif($bonustransfer > $user[credit]){ $msg="You dont have that many credits!"; } else{ $pimp = mysql_fetch_array(mysql_query("SELECT bonusturnsuses,crewjoindate,crewbonusturns,bonusturns,loyality,crew FROM `{$tab[pimp]}` WHERE `id`='$id' AND `rid`='$rid';"))or die("Error : " . mysql_error()); $user = mysql_fetch_array(mysql_query("SELECT credit FROM `{$tab[user]}` WHERE `id`='$id';"))or die("Error : " . mysql_error()); $bonustime=$time+172800;//bonus turns every 48 hours $crewquery = "SELECT members FROM `{$tab[crew]}` WHERE `id`='$id' AND `rid`='$rid'"; $ct=$crewquery["members"]; $cjd=$pimp["crewjoindate"]; $cbt=$pimp["crewbonusturns"]; $btu=$pimp["bonusturnsuses"]; $pcw=$pimp["crew"]; $btu=$pimp["bonusturnsuses"]; if($pcw<=0){$bt=0;} else{$bt=10;} $enddate=$time; $diff=$enddate-$cjd; // immediately convert to days $temp=$diff/86400; // 60 sec/min*60 min/hr*24 hr/day=86400 sec/day // days $days=floor($temp); $temp=24*($temp-$days); $ply=$pimp["loyality"]; if($pcw<=0){$xbt=0;} else{$xbt=$days*$bt;} if($pcw<=0){$lxbt=0;} else{$lxbt=$bt*$ply;} $bonusturns=$pimp["bonusturns"]+$cbt+$lxbt; $adminmessage="Auto-Response: you received ". $bonusturns ." bonus turns."; mysql_query("INSERT INTO `{$tab[mail]}` (rid,src,dest,msg,time,inbox) VALUES ('$rid','$adminid','$id','$adminmessage','$time',2);")or die("Error : " . mysql_error("tabmail error")); mysql_query("UPDATE `{$tab[pimp]}` SET `messages`=messages+1 WHERE `id`='$id' AND `rid`='$rid'")or die("Error : did not update message bin" . mysql_error()); mysql_query("UPDATE `{$tab[pimp]}` SET `bonusturnsuses`=$btu+1 WHERE `id`='$id' AND `rid`='$rid'")or die("Error : did not update bonus turn count" . mysql_error()); mysql_query("UPDATE `{$tab[pimp]}` SET `loyalityturns`=$lxbt WHERE `id`='$id' AND `rid`='$rid'")or die("Error : did not update loyality turn count" . mysql_error()); mysql_query("UPDATE `{$tab[pimp]}` SET `turn`=turn+$bonustransfer+$cbt+$lxbt, `bonusturntime`=$bonustime WHERE `id`='$id' AND `rid`='$rid'")or die("Error : did not give turns" . mysql_error()); mysql_query("UPDATE `{$tab[pimp]}` SET `crewbonusturns`=crewbonusturns+$xbt WHERE `id`='$id' AND `rid`='$rid'")or die("Error : did not give crew bonus turns" . mysql_error()); mysql_query("UPDATE `{$tab[user]}` SET `credit`=credit-$bonustransfer WHERE `id`='$id'")or die("Error :did not deduct credits from account " . mysql_error()); mysql_query("INSERT INTO `{$tab[credits]}` (id,username,action,time,ip) VALUES ('','$un','$adminmessage','$time','$REMOTE_ADDR');")or die ("Did not INSERT info into credit table " .mysql_error ()); header("Location: buyturns.php?rid=$rid"); } } $user = mysql_fetch_array(mysql_query("SELECT credit FROM `{$tab[user]}` WHERE `id`='$id';")); ?> <div class="inside_box_header">Your account currently has <?=commas($user["credit"])?> credits. <div class="inside_box"> <form method="post" action="bonuscredits.php?action=bonustransfer"> <b>transfer your credits for more turns</b> <input type="submit" class="button" value="transfer" name="bonustransfer"> <table align="center" cellspacing="1" cellpadding="4"> <?if($msg){?> <div class="boxdef-hd"> <div class="boxdef"> <center> <b><font color="#ffffff"> <?=$msg?> </font></b> </center> </div> </div> <?}?> </table> </form> </div> </div>
  5. .........Still getting the same warning and the file uploads. The $fileupload is the name of my input box <input type="file" class="text" name="fileupload"> Ok, I just realized that my host has changed the version of php they are using. It was PHP/4.3.9 , now it's PHP/4.4.7. Would this cause the issue? If so, any suggestions on how to fix the code and/or ask my server tech a specific question?
  6. Warning: getimagesize(Array) [function.getimagesize]: failed to open stream: No such file or directory in... The image is uploading fine in the DB and is displaying properly on the web page. So why would I get this error? This code has worked in the past. Only recently has this been happening. Any ideas??? if ($fileupload) { $arr_allow_ex=array("gif","jpg","png"); $uploadpath=$dir."/"; $source=$_FILES[fileupload][tmp_name]; $fileupload_name=$_FILES[fileupload][name]; $weight=$_FILES[fileupload][size]; $imagehw = GetImageSize($fileupload); $imagewidth = $imagehw[0]; $imageheight = $imagehw[1]; if (($crew["founder"] != $user["pimp"]) && ($crew["cofounder"] != $user["pimp"])) { $message='you are not the founder of this crew.'; } elseif ($imagewidth >= 33){$message="image width to big ($imagewidth pixels)";} elseif ($imageheight >= 33){$message="image height to big ($imageheight pixels)";} else{ for($i=0;$i<count($arr_allow_ex);$i++) { if(getlast($fileupload_name)!=$arr_allow_ex[$i]) $test.="~~"; } $exp=explode("~~",$test); if(strstr($fileupload_name, " ")) {$message='you cannot have spaces in file name.';} elseif(count($exp)==(count($arr_allow_ex)+1)){$message='invalid image type.';} elseif($weight>$wei_fileupload){$message="File is to large (".$wei_fileupload." bytes)";} else{ $fileupload_name="$fileupload_name$time"; $dest = ''; if ( ($source != 'none') && ($source != '' )) { $dest=$uploadpath.$fileupload_name; if ($dest != '') { if (copy($source,$dest)) { $exfile=explode(".",$fileupload_name); $message="icon has been set successfully!"; mysql_query("UPDATE `{$tab[crew]}` SET `icon`='$dir$fileupload_name' WHERE `name`='$crw' AND rid='$rid'"); } } } } } }
  7. This script has been the same for years and is a common script for two other pages and they seem to be working fine. It keeps telling me "I don't have enough turns" when I do. I even checked in the DB and the turns are there. I put in a script to even tell me how many turns I had and that worked on the same page. Any ideas???? $user = mysql_fetch_array(mysql_query("SELECT turn,cash,thugs,hoes,medicine,lowrider,worth,ak47,informant,upper,lower FROM `{$tab[pimp]}` WHERE `id`='$id' AND `rid`='$rid';")); if (isset($_REQUEST["keyboard"])) $keyboard=$_REQUEST["keyboard"]; else $keyboard=""; if (isset($_REQUEST["location"])) $location=$_REQUEST["location"]; else $location=""; if (isset($_REQUEST["turns"])) $turns=$_REQUEST["turns"]; else $turns=""; $error=""; if(($keyboard=="enter") && ($turns > 0)) { if (($turns > $user["turn"]) || ($turns < 0) || (!preg_match('/^[0-9][0-9]*$/i', $turns))) { $error="You dont have enough turns!"; } elseif($turns > 60){$error="you can only use up to 60 turns!";} elseif($turns <= 9){$error="you have to use 10 or higher!";} else { srand ((double) microtime() * 1000000); //WHORE SCOUT $scouts=$turns; while ($scouts>0){ if($scouts > 25){ $hoe=round($hoe+(rand(4,)); $thug=round($thug+(rand(6,9))); $scouts=($scouts-25); } if($scouts > 15){ $hoe=round($hoe+(rand(3,6))); $thug=round($thug+(rand(3,6))); $scouts=($scouts-15); } elseif($scouts >= 10){ $hoe=round($hoe+(rand(2,4))); $thug=round($thug+(rand(0,3))); $scouts=($scouts-10); } elseif($scouts >= 5){ $hoe=round($hoe+(rand(0,2))); $thug=round($thug+(rand(0,3))); $scouts=($scouts-5); } else{ $hoe=round($hoe+(rand(0,$scouts))); $thug=round($thug+(rand(0,$scouts))); $scouts=($scouts-$scouts); } }
  8. I'm looking a few things, i'll get back when I see something....
  9. Ok, I have a list of these functions on a separate php file and I use the include() statement on another php file to load this function page into it. The functions work properly but for every function I use a 0 appears at the top of the DIV the include() statement is in. So, I have exactly nine 0's in a row because I have nine separate functions. Any ideas what is going on here? lol. $mint = $user["medicine"]; function mformat($number) { $suffix = array('', ' K', ' M', ' B',' T', ' Q'); $max = count($suffix) - 1; while ($number >= 1000 and $i < $max){ $number /= 1000; $i++; } $number = round($number, 2); return $number . $suffix[$i]; } echo mformat($mint);
  10. I need this function to figure up to quadrillion. I know that isn't even right for trillion. I'm sure it's something silly and small but I'm having a brainfart, any help please? function hformat($number) { $suffix = array('', ' K', ' M', ' B',' T'); for($i = 0, $max = sizeof($suffix)-2; $i < $max; $i++) { $pos = strpos($number, '.'); if ($pos !== false) { $length = strlen(substr($number, 0, $pos)); } else { $length = strlen($number); } if ($length < 4) { break; } $number = round($number / 1000, 2); } return $number . $suffix[$i]; } echo hformat($hint);
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.