Jump to content

greenbman

Members
  • Posts

    28
  • Joined

  • Last visited

Everything posted by greenbman

  1. Hahah! I figured it out the return "e_1" to "e_3" were reversed it was that I actually did not have enough iron!
  2. Ok so I have a function that is adding numbers to row in table and for some reason each type is being limited eg type 1 can only add up to 14 at a time any more that the the function returns e_1. Also type 2 limits $amt to 6 if I input more than 6 eg 7 it returns e_1 as well. And I can do multiple submits of 6 that returns a s_1 which is what I want and I have enough $onhandE to do transaction but for some reason its limiting it. function: <?php function createSloppyCheeseBugs($type, $iron, $plat, $energy, $onhandI, $onhandP, $onhandE, $amt, $id, $pid){ if($type==1){ $ironAMT = bcmul($iron, $amt); $platAMT = bcmul($plat, $amt); $energyAMT = bcmul($energy, $amt); if($ironAMT<=$onhandI){ if($platAMT<=$onhandP){ if($energyAMT<=$onhandE){ $q="UPDATE `shipyard` SET `smallcargo` = `smallcargo`+'{$amt}' WHERE `id` = '$id'"; $q2="UPDATE `planets` SET `Iron_Res` = `Iron_Res`-'{$ironAMT}', `Plat_Res` = `Plat_Res`-'{$platAMT}', `Energy_Res` = `Energy_Res`-'{$energyAMT}' WHERE `planetID` = '{$planetID}'"; $res = mysql_query($q) or die(mysql_error()); $res2 = mysql_query($q2) or die(mysql_error()); if(isset($res)){ if(isset($res2)){ return "s_1"; } } }else{ return "e_1"; } }else{ return "e_2"; } }else{ return "e_3"; } } if($type==2){ $ironAMT = bcmul($iron, $amt); $platAMT = bcmul($plat, $amt); $energyAMT = bcmul($energy, $amt); if($ironAMT<=$onhandI){ if($platAMT<=$onhandP){ if($energyAMT<=$onhandE){ $q="UPDATE `shipyard` SET `largecargo` = `largecargo`+'{$amt}' WHERE `id` = '$id'"; $q2="UPDATE `planets` SET `Iron_Res` = `Iron_Res`-'{$ironAMT}', `Plat_Res` = `Plat_Res`-'{$platAMT}', `Energy_Res` = `Energy_Res`-'{$energyAMT}' WHERE `planetID` = '{$planetID}'"; $res = mysql_query($q) or die(mysql_error()); $res2 = mysql_query($q2) or die(mysql_error()); if(isset($res)){ if(isset($res2)){ return "s_1"; } } }else{ return "e_1"; } }else{ return "e_2"; } }else{ return "e_3"; } } if($type==3){ $ironAMT = bcmul($iron, $amt); $platAMT = bcmul($plat, $amt); $energyAMT = bcmul($energy, $amt); if($ironAMT<=$onhandI){ if($platAMT<=$onhandP){ if($energyAMT<=$onhandE){ $q="UPDATE `shipyard` SET `cruiser` = `cruiser`+'{$amt}' WHERE `id` = '$id'"; $q2="UPDATE `planets` SET `Iron_Res` = `Iron_Res`-'{$ironAMT}', `Plat_Res` = `Plat_Res`-'{$platAMT}', `Energy_Res` = `Energy_Res`-'{$energyAMT}' WHERE `planetID` = '{$planetID}'"; $res = mysql_query($q) or die(mysql_error()); $res2 = mysql_query($q2) or die(mysql_error()); if(isset($res)){ if(isset($res2)){ return "s_1"; } } }else{ return "e_1"; } }else{ return "e_2"; } }else{ return "e_3"; } } if($type==4){ $ironAMT = bcmul($iron, $amt); $platAMT = bcmul($plat, $amt); $energyAMT = bcmul($energy, $amt); if($ironAMT<=$onhandI){ if($platAMT<=$onhandP){ if($energyAMT<=$onhandE){ $q="UPDATE `shipyard` SET `heavycrusier` = `heavycrusier`+'{$amt}' WHERE `id` = '$id'"; $q2="UPDATE `planets` SET `Iron_Res` = `Iron_Res`-'{$ironAMT}', `Plat_Res` = `Plat_Res`-'{$platAMT}', `Energy_Res` = `Energy_Res`-'{$energyAMT}' WHERE `planetID` = '{$planetID}'"; $res = mysql_query($q) or die(mysql_error()); $res2 = mysql_query($q2) or die(mysql_error()); if(isset($res)){ if(isset($res2)){ return "s_1"; } } }else{ return "e_1"; } }else{ return "e_2"; } }else{ return "e_3"; } } if($type==5){ $ironAMT = bcmul($iron, $amt); $platAMT = bcmul($plat, $amt); $energyAMT = bcmul($energy, $amt); if($ironAMT<=$onhandI){ if($platAMT<=$onhandP){ if($energyAMT<=$onhandE){ $q="UPDATE `shipyard` SET `warship` = `warship`+'{$amt}' WHERE `id` = '$id'"; $q2="UPDATE `planets` SET `Iron_Res` = `Iron_Res`-'{$ironAMT}', `Plat_Res` = `Plat_Res`-'{$platAMT}', `Energy_Res` = `Energy_Res`-'{$energyAMT}' WHERE `planetID` = '{$planetID}'"; $res = mysql_query($q) or die(mysql_error()); $res2 = mysql_query($q2) or die(mysql_error()); if(isset($res)){ if(isset($res2)){ return "s_1"; } } }else{ return "e_1"; } }else{ return "e_2"; } }else{ return "e_3"; } } if($type==6){ $ironAMT = bcmul($iron, $amt); $platAMT = bcmul($plat, $amt); $energyAMT = bcmul($energy, $amt); if($ironAMT<=$onhandI){ if($platAMT<=$onhandP){ if($energyAMT<=$onhandE){ $q="UPDATE `shipyard` SET `recycler` = `recycler`+'{$amt}' WHERE `id` = '$id'"; $q2="UPDATE `planets` SET `Iron_Res` = `Iron_Res`-'{$ironAMT}', `Plat_Res` = `Plat_Res`-'{$platAMT}', `Energy_Res` = `Energy_Res`-'{$energyAMT}' WHERE `planetID` = '{$planetID}'"; $res = mysql_query($q) or die(mysql_error()); $res2 = mysql_query($q2) or die(mysql_error()); if(isset($res)){ if(isset($res2)){ return "s_1"; } } }else{ return "e_1"; } }else{ return "e_2"; } }else{ return "e_3"; } } if($type==7){ $ironAMT = bcmul($iron, $amt); $platAMT = bcmul($plat, $amt); $energyAMT = bcmul($energy, $amt); if($ironAMT<=$onhandI){ if($platAMT<=$onhandP){ if($energyAMT<=$onhandE){ $q="UPDATE `shipyard` SET `slaveship` = `slaveship`+'{$amt}' WHERE `id` = '$id'"; $q2="UPDATE `planets` SET `Iron_Res` = `Iron_Res`-'{$ironAMT}', `Plat_Res` = `Plat_Res`-'{$platAMT}', `Energy_Res` = `Energy_Res`-'{$energyAMT}' WHERE `planetID` = '{$planetID}'"; $res = mysql_query($q) or die(mysql_error()); $res2 = mysql_query($q2) or die(mysql_error()); if(isset($res)){ if(isset($res2)){ return "s_1"; } } }else{ return "e_1"; } }else{ return "e_2"; } }else{ return "e_3"; } } } ?> Calling code: if(isset($_POST['hidsc'])){ $amt = anti_injection($_POST['BLDSC']); $query = "SELECT * FROM `shipyard` WHERE `owner_id` = '{$ui['planetID']}'"; $res = mysql_query($query) or die(mysql_error()); $row = mysql_fetch_array($res); $res = createSloppyCheeseBugs(1, 85000000, 98000000, 30000, $pi['Iron_Res'], $pi['Plat_Res'], $pi['Energy_Res'], $amt, $row['id'], $ui['planetID']); if(isset($res)){ if($res == "e_1"){ $msg = "Insufficient Iron!"; } if($res == "e_2"){ $msg = "Insufficient Platinum!"; } if($res == "e_3"){ $msg = "Insufficient Energy!"; } if($res == "s_1"){ $msg = "Ship Construction Completed!"; } } } if(isset($_POST['hidlc'])){ $amt = anti_injection($_POST['BLDLC']); $query = "SELECT * FROM `shipyard` WHERE `owner_id` = '{$ui['planetID']}'"; $res = mysql_query($query) or die(mysql_error()); $row = mysql_fetch_array($res); $res = createSloppyCheeseBugs(2, 185000000, 198000000, 130000, $pi['Iron_Res'], $pi['Plat_Res'], $pi['Energy_Res'], $amt, $row['id'], $ui['planetID']); if(isset($res)){ if($res == "e_1"){ $msg = "Insufficient Iron!"; } if($res == "e_2"){ $msg = "Insufficient Platinum!"; } if($res == "e_3"){ $msg = "Insufficient Energy!"; } if($res == "s_1"){ $msg = "Ship Construction Completed!"; } } } if(isset($_POST['hidc'])){ $amt = anti_injection($_POST['BLDC']); $query = "SELECT * FROM `shipyard` WHERE `owner_id` = '{$ui['planetID']}'"; $res = mysql_query($query) or die(mysql_error()); $row = mysql_fetch_array($res); $res = createSloppyCheeseBugs(3, 385000000, 398000000, 330000, $pi['Iron_Res'], $pi['Plat_Res'], $pi['Energy_Res'], $amt, $row['id'], $ui['planetID']); if(isset($res)){ if($res == "e_1"){ $msg = "Insufficient Iron!"; } if($res == "e_2"){ $msg = "Insufficient Platinum!"; } if($res == "e_3"){ $msg = "Insufficient Energy!"; } if($res == "s_1"){ $msg = "Ship Construction Completed!"; } } } if(isset($_POST['hidhc'])){ $amt = anti_injection($_POST['BLDHC']); $query = "SELECT * FROM `shipyard` WHERE `owner_id` = '{$ui['planetID']}'"; $res = mysql_query($query) or die(mysql_error()); $row = mysql_fetch_array($res); $res = createSloppyCheeseBugs(4, 485000000, 498000000, 430000, $pi['Iron_Res'], $pi['Plat_Res'], $pi['Energy_Res'], $amt, $row['id'], $ui['planetID']); if(isset($res)){ if($res == "e_1"){ $msg = "Insufficient Iron!"; } if($res == "e_2"){ $msg = "Insufficient Platinum!"; } if($res == "e_3"){ $msg = "Insufficient Energy!"; } if($res == "s_1"){ $msg = "Ship Construction Completed!"; } } } if(isset($_POST['hidw'])){ $amt = anti_injection($_POST['BLDW']); $query = "SELECT * FROM `shipyard` WHERE `owner_id` = '{$ui['planetID']}'"; $res = mysql_query($query) or die(mysql_error()); $row = mysql_fetch_array($res); $res = createSloppyCheeseBugs(5, 685000000, 698000000, 630000, $pi['Iron_Res'], $pi['Plat_Res'], $pi['Energy_Res'], $amt, $row['id'], $ui['planetID']); if(isset($res)){ if($res == "e_1"){ $msg = "Insufficient Iron!"; } if($res == "e_2"){ $msg = "Insufficient Platinum!"; } if($res == "e_3"){ $msg = "Insufficient Energy!"; } if($res == "s_1"){ $msg = "Ship Construction Completed!"; } } } if(isset($_POST['hidr'])){ $amt = anti_injection($_POST['BLDR']); $query = "SELECT * FROM `shipyard` WHERE `owner_id` = '{$ui['planetID']}'"; $res = mysql_query($query) or die(mysql_error()); $row = mysql_fetch_array($res); $res = createSloppyCheeseBugs(6, 25400000, 22540000, 15000, $pi['Iron_Res'], $pi['Plat_Res'], $pi['Energy_Res'], $amt, $row['id'], $ui['planetID']); if(isset($res)){ if($res == "e_1"){ $msg = "Insufficient Iron!"; } if($res == "e_2"){ $msg = "Insufficient Platinum!"; } if($res == "e_3"){ $msg = "Insufficient Energy!"; } if($res == "s_1"){ $msg = "Ship Construction Completed!"; } } } if(isset($_POST['hidss'])){ $amt = anti_injection($_POST['BLDSS']); $query = "SELECT * FROM `shipyard` WHERE `owner_id` = '{$ui['planetID']}'"; $res = mysql_query($query) or die(mysql_error()); $row = mysql_fetch_array($res); $res = createSloppyCheeseBugs(7, 15000000, 28000000, 340000, $pi['Iron_Res'], $pi['Plat_Res'], $pi['Energy_Res'], $amt, $row['id'], $ui['planetID']); if(isset($res)){ if($res == "e_1"){ $msg = "Insufficient Iron!"; } if($res == "e_2"){ $msg = "Insufficient Platinum!"; } if($res == "e_3"){ $msg = "Insufficient Energy!"; } if($res == "s_1"){ $msg = "Ship Construction Completed!"; } } } Any help with this would be awesome! greenbman
  3. Yeah go ahead and post the entire code. It will allow me to see all of it in one piece.
  4. Ok so I figured it out: // Get Mar Prices. $marp1 = "120250"; $marp2 = "90670"; $marp3 = "500"; $marp4 = "2"; $marprice1 = bcmul($mar, $marp1); $marprice2 = bcmul($mar, $marp2); $marprice3 = bcmul($mar, $marp3); $marprice4 = bcmul($mar, $marp4); $maurprice1 = bcmul(445620, $maur); $maurprice2 = bcmul(180645, $maur); $maurprice3 = bcmul(1000, $maur); $maurprice4 = bcmul(4, $maur); $irtprice1 = bcmul(25160, $irt); $irtprice2 = bcmul(13690, $irt); $irtprice3 = bcmul(120, $irt); $irtprice4 = bcmul(1, $irt); $ptprice1 = bcmul(25160, $pt); $ptprice2 = bcmul(13690, $pt); $ptprice3 = bcmul(120, $pt); $ptprice4 = bcmul(1, $pt); $espprice1 = bcmul(162324, $esp); $espprice2 = bcmul(67670, $esp); $espprice3 = bcmul(300, $esp); $espprice4 = bcmul(6, $esp); $stprice1 = bcmul(25160, $st); $stprice2 = bcmul(13690, $st); $stprice3 = bcmul(150, $st); $stprice4 = bcmul(1, $st); $ftprice1 = bcmul(55190, $ft); $ftprice2 = bcmul(26050, $ft); $ftprice3 = bcmul(300, $ft); $ftprice4 = bcmul(2, $ft); $rprice1 = bcmul(6550, $r); $rprice2 = bcmul(4670, $r); $rprice3 = bcmul(50, $r); $rprice4 = bcmul(2, $r); $bprice1 = bcmul(20250, $B); $bprice2 = bcmul(19670, $B); $bprice3 = bcmul(38, $B); $bprice4 = bcmul(8, $B); So Evidently bcmul(parameter, parameter) is what PHP is more likely to accept. This basically multiplys one parameter by another. My script is working now thanks for the views, greenbman
  5. I do not see anywhere on this page that makes it redirect again. Is this the redirected page or the original page?
  6. Or: $submiturl = "./documents_add.php?id=".$_SESSION['id'];
  7. You could use a session. Place this on the first line of code: <?php session_start(); then you can do this: $_SESSION['id'] = $_GET['id']; and when it redirects again: $getID_On_Redirect = $_SESSION['id']; echo $getID_On_Redirect; greenbman
  8. I would have to see the rest of the code on the page what triggers the second redirection?
  9. I believe this $submiturl = "./documents_add.php?id=$_GET["id"])"; should be $submiturl = "./documents_add.php?id=".$_GET["id"]; There was a bracket at the end and I believe that you only use + var + in javascript not php. hope this helps, greenbman
  10. I believe this needs to be posted in a Javascript help section and not in PHP. I see no PHP greenbman
  11. Ok I have no clue why I used that way of doing it so I though hey well I guess I could change it to regular variables so that is what I did: <?php // Get Mar Prices. if($mar>=1){ $marprice1 = (120250 * $mar); $marprice2 = (90670 * $mar); $marprice3=(500 * $mar); $marprice4=(2 * $mar); }else{ $marprice2 = 0; $marprice3 = 0; $marprice4 = 0; } if($maur>=1){ $maurprice1 = (445620 * $maur); $maurprice2 = (180645 * $maur); $maurprice3 = (1000 * $maur); $maurprice4 = (4 * $maur); }else{ $maurprice1 = 0; $maurprice2 = 0; $maurprice3 = 0; $maurprice4 = 0; } if($irt>=1){ $irtprice1 = (25160 * $irt); $irtprice2 = (13690 * $irt); $irtprice3 = (120 * $irt); $irtprice4 = (1 * $irt); }else{ $irtprice1 = 0; $irtprice2 = 0; $irtprice3 = 0; $irtprice4 = 0; } if($pt>=1){ $ptprice1 = (25160 * $pt); $ptprice2 = (13690 * $pt); $ptprice3 = (120 * $pt); $ptprice4 = (1 * $pt); }else{ $ptprice1 = 0; $ptprice2 = 0; $ptprice3 = 0; $ptprice4 = 0; } if($esp>=1){ $espprice1 = (162324 * $esp); $espprice2 = (67670 * $esp); $espprice3 = (300 * $esp); $espprice4 = (6 * $esp); }else{ $espprice1 = 0; $espprice2 = 0; $espprice2 = 0; $espprice4 = 0; } if($st>=1){ $stprice1 = (25160 * $st); $stprice2 = (13690 * $st); $stprice3 = (150 * $st); $stprice4 = (1 * $st); }else{ $stprice1 = 0; $stprice2 = 0; $stprice2 = 0; $stprice3 = 0; } if($ft>=1){ $ftprice1 = (55190 * $ft); $ftprice2 = (26050 * $ft); $ftprice3 = (300 * $ft); $ftprice4 = (2 * $ft); }else{ $ftprice1 = 0; $ftprice2 = 0; $ftprice3 = 0; $ftprice4 = 0; } if($r>=1){ $rprice1 = (6550 * $r); $rprice2 = (4670 * $r); $rprice3 = (50 * $r); $rprice4 = (2 * $r); }else{ $rprice1 = 0; $rprice1 = 0; $rprice3 = 0; $rprice4 = 0; } if($b>=1){ $bprice1 = (20250 * $B); $bprice2 = (19670 * $B); $bprice3 = (38 * $B); $bprice4 = (8 * $B); }else{ $bprice1 = 0; $bprice2 = 0; $bprice3 = 0; $bprice4 = 0; } $totalIron = ($marprice1+$maurprice1+$bprice1+$rprice1+$ftprice1+$stprice1+$espprice1+$ptprice1+$irtprice1); $totalPlat = ($marprice2+$maurprice2+$bprice2+$rprice2+$ftprice2+$stprice2+$espprice2+$ptprice2+$irtprice2); $totalEnergy = ($marprice3+$maurprice3+$bprice3+$rprice3+$ftprice3+$stprice3+$espprice3+$ptprice3+$irtprice3); $totalCitizen = ($marprice4+$maurprice4+$bprice4+$rprice4+$ftprice4+$stprice4+$espprice4+$ptprice4+$irtprice4); ?> And still it is like the Variable Holds no Information at all but when I die the $mar variable the information is there. Please help, greenbman
  12. "Headers already sent" means that your PHP script already sent the HTTP headers, and as such it can't make modifications to them now. Check that you don't send ANY content before calling session_start. Better yet, just make session_start the first thing you do in your PHP file (so put it at the absolute beginning, before all HTML etc).
  13. Ok so I am not using a traditional array here is what I have: FUNCTION assignOnSloppyCheeseBall($train, $mar, $maur, $irt, $pt, $esp, $st, $ft, $r, $b, $iron, $plat, $energy, $citizen, $planetID){ if($train == 1){ // Get Mar Prices. if($mar>=1){ $price["mar"]["p1"] = (120250 * $mar); $price["mar"]["p2"] = (90670 * $mar); $price["mar"]["p3"] = (500 * $mar); $price["mar"]["p4"] = (2 * $mar); }else{ $price["mar"]["p1"] = 0; $price["mar"]["p2"] = 0; $price["mar"]["p3"] = 0; $price["mar"]["p4"] = 0; } if($maur>=1){ $price["maur"]["p1"] = (445620 * $maur); $price["maur"]["p2"] = (180645 * $maur); $price["maur"]["p3"] = (1000 * $maur); $price["maur"]["p4"] = (4 * $maur); }else{ $price["maur"]["p1"] = 0; $price["maur"]["p2"] = 0; $price["maur"]["p3"] = 0; $price["maur"]["p4"] = 0; } if($irt>=1){ $price["irt"]["p1"] = (25160 * $irt); $price["irt"]["p2"] = (13690 * $irt); $price["irt"]["p3"] = (120 * $irt); $price["irt"]["p4"] = (1 * $irt); }else{ $price["irt"]["p1"] = 0; $price["irt"]["p2"] = 0; $price["irt"]["p3"] = 0; $price["irt"]["p4"] = 0; } if($pt>=1){ $price["pt"]["p1"] = (25160 * $pt); $price["pt"]["p2"] = (13690 * $pt); $price["pt"]["p3"] = (120 * $pt); $price["pt"]["p4"] = (1 * $pt); }else{ $price["pt"]["p1"] = 0; $price["pt"]["p2"] = 0; $price["pt"]["p3"] = 0; $price["pt"]["p4"] = 0; } if($esp>=1){ $price["esp"]["p1"] = (162324 * $esp); $price["esp"]["p2"] = (67670 * $esp); $price["esp"]["p3"] = (300 * $esp); $price["esp"]["p4"] = (6 * $esp); }else{ $price["esp"]["p1"] = 0; $price["esp"]["p2"] = 0; $price["esp"]["p3"] = 0; $price["esp"]["p4"] = 0; } if($st>=1){ $price["st"]["p1"] = (25160 * $st); $price["st"]["p2"] = (13690 * $st); $price["st"]["p3"] = (150 * $st); $price["st"]["p4"] = (1 * $st); }else{ $price["st"]["p1"] = 0; $price["st"]["p2"] = 0; $price["st"]["p3"] = 0; $price["st"]["p4"] = 0; } if($ft>=1){ $price["ft"]["p1"] = (55190 * $ft); $price["ft"]["p2"] = (26050 * $ft); $price["ft"]["p3"] = (300 * $ft); $price["ft"]["p3"] = (2 * $ft); }else{ $price["ft"]["p1"] = 0; $price["ft"]["p2"] = 0; $price["ft"]["p3"] = 0; $price["ft"]["p4"] = 0; } if($r>=1){ $price["r"]["p1"] = (6550 * $r); $price["r"]["p2"] = (4670 * $r); $price["r"]["p3"] = (50 * $r); $price["r"]["p4"] = (2 * $r); }else{ $price["r"]["p1"] = 0; $price["r"]["p2"] = 0; $price["r"]["p3"] = 0; $price["r"]["p4"] = 0; } if($b>=1){ $price["b"]["p1"] = (20250 * $B); $price["b"]["p2"] = (19670 * $B); $price["b"]["p3"] = (38 * $B); $price["b"]["p4"] = (8 * $B); }else{ $price["b"]["p1"] = 0; $price["b"]["p2"] = 0; $price["b"]["p3"] = 0; $price["b"]["p4"] = 0; } $totalIron = ($price["b"]["p1"]+$price["r"]["p1"]+$price["ft"]["p1"]+$price["st"]["p1"]+$price["esp"]["p1"]+$price["irt"]["p1"]+$price["maur"]["p1"]+$price["mar"]["p1"]); $totalPlat = ($price["b"]["p2"]+$price["r"]["p2"]+$price["ft"]["p2"]+$price["st"]["p2"]+$price["esp"]["p2"]+$price["irt"]["p2"]+$price["maur"]["p2"]+$price["mar"]["p2"]); $totalEnergy = ($price["b"]["p3"]+$price["r"]["p3"]+$price["ft"]["p3"]+$price["st"]["p3"]+$price["esp"]["p3"]+$price["irt"]["p3"]+$price["maur"]["p3"]+$price["mar"]["p3"]); $totalCitizen = ($price["b"]["p4"]+$price["r"]["p4"]+$price["ft"]["p4"]+$price["st"]["p4"]+$price["esp"]["p4"]+$price["irt"]["p4"]+$price["maur"]["p4"]+$price["mar"]["p4"]); if($iron >= $totalIron){ if($plat>=$totalPlat){ if($energy>=$totalEnergy){ if($citizen>=$totalCitizen){ $q="UPDATE `population` SET marines_res = marines_res+'$mar', mauraders_res = mauraders_res+'$maur', espmerc_res = espmerc_res+'$esp', irontech_res = irontech_res+'$irt', platinumtech_res = platinumtech_res+'$pt', solartech_res = solartech_res+'$st', fusiontech_res = fusiontech_res+'$ft', recruiters_res = recruiters_res+'$r', builders_res = builders_res+'$b' WHERE `planetID` = '$planetID'"; $q2="UPDATE `planets` SET `Iron_Res` = `Iron_Res`-'$totalIron', `Plat_Res` = `Plat_Res`-'$totalPlat', `Energy_Res` = `Energy_Res`-'$totalEnergy', `Citizens_Res` = `Citizens_Res`-'$totalCitizen' WHERE `planetID` = '$planetID'"; $res = mysql_query($q) or die(mysql_error()); $res2 = mysql_query($q2) or die(mysql_error()); if(isset($res)){ if(isset($res2)){ return "s_1"; } } }else{ return "e_1"; } }else{ return "e_2"; } }else{ return "e_3"; } }else{ return "e_4"; } } } So for some reason they arent holding any information when they should. Thanks, greenbman
  14. Ok so I was needing to know if I can do this: SELECT * FROM `accounts` ORDER BY `ctime` WHERE `ctime` >='$time' ASC can I do a WHERE `ctime` >= '$time' ? And how do it? Because when I run this nothing happens. Thanks, greenbman
  15. My question is how are the sessions even working in index.php when I do not see a session_start(); function on line 1?
  16. Well due to Google I have figured out my Problem it was a "}" from line 121 I added it and now this works thanks for the views greenbman
  17. I have no clue what this error means? Parse error: syntax error, unexpected $end in /home/#####/public_html/buildings.php on line 348 Here is my code: <?php require_once("libfunc/funcvars.php"); /** * @author ############## * @copyright 2013 */ $gi = getSloppyCheeseKing(); if($_SESSION["overall_id"]<=0){ header("location: home.php?strval=5"); } $ui = getSloppyCheese($_SESSION["overall_id"]); $pi = getSloppyCheeseBall($ui['planetID']); $usrnc = number_format($ui['usrnc']); $plntnc = number_format($ui['plntnc']); $pname = anti_injection($pi['PlanetName']); $iron = number_format(anti_injection($pi['Iron_Res'])); $plat = number_format(anti_injection($pi['Plat_Res'])); $energy = number_format(anti_injection($pi['Energy_Res'])); $citizen = number_format(anti_injection($pi['Citizens_Res'])); $title = anti_injection($gi['GameName']); $slogan = anti_injection($gi['Slogan']); if(isset($_GET['strval'])){ $strval = anti_injection($_GET['strval']); } if(isset($_POST['UPGIron'])){ $query = "SELECT * FROM `buildings` WHERE `owner_id` = '{$ui['planetID']}'"; $res = mysql_query($query) or die(mysql_error()); $row = mysql_fetch_array($res); $res = buildOnSloppyCheeseBall(1, $row['ironbaseprice1'], $row['ironbaseprice2'], $row['ironbaseprice3'], $row['ironminelevel'], $ui['planetID'], $pi['Iron_Res'], $pi['Plat_Res'], $pi['Energy_Res']); if(isset($res)){ if($res == "e_1"){ $msg = "Insufficient Iron!"; } if($res == "e_2"){ $msg = "Insufficient Platinum!"; } if($res == "e_3"){ $msg = "Insufficient Energy!"; } if($res == "s_1"){ $msg = "Upgrade Completed!"; } } } if(isset($_POST['UPGPlat'])){ $query = "SELECT * FROM `buildings` WHERE `owner_id` = '{$ui['planetID']}'"; $res = mysql_query($query) or die(mysql_error()); $row = mysql_fetch_array($res); $res = buildOnSloppyCheeseBall(2, $row['platbaseprice1'], $row['platbaseprice2'], $row['platbaseprice3'], $row['platminelevel'], $ui['planetID'], $pi['Iron_Res'], $pi['Plat_Res'], $pi['Energy_Res']); if(isset($res)){ if($res == "e_1"){ $msg = "Insufficient Iron!"; } if($res == "e_2"){ $msg = "Insufficient Platinum!"; } if($res == "e_3"){ $msg = "Insufficient Energy!"; } if($res == "s_1"){ $msg = "Upgrade Completed!"; } } } if(isset($_POST['UPGSolar'])){ $query = "SELECT * FROM `buildings` WHERE `owner_id` = '{$ui['planetID']}'"; $res = mysql_query($query) or die(mysql_error()); $row = mysql_fetch_array($res); $res = buildOnSloppyCheeseBall(3, $row['solarbaseprice1'], $row['solarbaseprice2'], $row['solarbaseprice3'], $row['solarminelevel'], $ui['planetID'], $pi['Iron_Res'], $pi['Plat_Res'], $pi['Energy_Res']); if(isset($res)){ if($res == "e_1"){ $msg = "Insufficient Iron!"; } if($res == "e_2"){ $msg = "Insufficient Platinum!"; } if($res == "e_3"){ $msg = "Insufficient Energy!"; } if($res == "s_1"){ $msg = "Upgrade Completed!"; } } } if(isset($_POST['UPGFusion'])){ $query = "SELECT * FROM `buildings` WHERE `owner_id` = '{$ui['planetID']}'"; $res = mysql_query($query) or die(mysql_error()); $row = mysql_fetch_array($res); $res = buildOnSloppyCheeseBall(4, $row['fusionbaseprice1'], $row['fusionbaseprice2'], $row['fusionbaseprice3'], $row['fusionminelevel'], $ui['planetID'], $pi['Iron_Res'], $pi['Plat_Res'], $pi['Energy_Res']); if(isset($res)){ if($res == "e_1"){ $msg = "Insufficient Iron!"; } if($res == "e_2"){ $msg = "Insufficient Platinum!"; } if($res == "e_3"){ $msg = "Insufficient Energy!"; } if($res == "s_1"){ $msg = "Upgrade Completed!"; } } if(isset($_POST['UPGRecruit'])){ $query = "SELECT * FROM `buildings` WHERE `owner_id` = '{$ui['planetID']}'"; $res = mysql_query($query) or die(mysql_error()); $row = mysql_fetch_array($res); $res = buildOnSloppyCheeseBall(5, $row['recruitbaseprice1'], $row['recruitbaseprice2'], $row['recruitbaseprice3'], $row['recruitminelevel'], $ui['planetID'], $pi['Iron_Res'], $pi['Plat_Res'], $pi['Energy_Res']); if(isset($res)){ if($res == "e_1"){ $msg = "Insufficient Iron!"; } if($res == "e_2"){ $msg = "Insufficient Platinum!"; } if($res == "e_3"){ $msg = "Insufficient Energy!"; } if($res == "s_1"){ $msg = "Upgrade Completed!"; } } } ?> <html> <head> <title>############## </title> <style type="text/css"> body{ background-color:#000000; } #topbar{ position:absolute; width:986px; height:196px; background-image:url("images/IngameHeader.png"); } #navbar{ position:absolute; top:196px; width:986px; height:40px; } #leftnav{ position:absolute; top:236px; left:60px; width:201px; height:940px; background-image:url("images/LeftNav.png"); } #maincontent{ position:absolute; top:236px; left:270px; </style> <script type="text/javascript" language="javascript" src="script.js"></script> <link rel="stylesheet" type="text/css" href="style.css" /> </head> <body> <div id="topbar"> </div> <div id="navbar"> <img src="images/IngameNav.png" width="986" height="40" border="0" alt="" usemap="#IngameNav_Map"> <map name="IngameNav_Map"> <area shape="rect" alt="" coords="770,0,843,40" href="signout.php"> <area shape="rect" alt="" coords="542,0,643,40" href="population.php"> <area shape="rect" alt="" coords="414,0,488,40" href="shipyard.php"> <area shape="rect" alt="" coords="284,0,366,40" href="buildings.php"> <area shape="rect" alt="" coords="168,0,240,40" href="account.php"> </map> </div> <div id="leftnav"> </div> <div id="maincontent"> <img src="src_img/bover.png" id="bover" /> <span class="hotspot1" ><?php if(isset($msg)){?><b><font color='red'><?php print $msg;?></font></b><?php }?></span> <center><img src="src_img/planetary_rec.png" onmouseover="tooltip.show('<center><h3><span><?php print $pname;?></span></h3><b>Iron: <span><?php print $iron;?></span> units<br /></b><b>Platinum: <span><?php print $plat;?></span> units<br /></b><b> Energy: <span><?php print $energy;?></span> units<br /></b><b>Citizen: <span><?php print $citizen;?></span> units<br /></b></center>');" onmouseout="tooltip.hide();" style="cursor:pointer;" /></center> <?php $query = "SELECT * FROM `buildings` WHERE `owner_id` = '{$ui['planetID']}'"; $res = mysql_query($query) or die(mysql_error()); $row = mysql_fetch_array($res); $count = mysql_num_rows($res); if($count<=0){ $query = "INSERT INTO `buildings` SET `owner_id` = '{$ui['planetID']}'"; $res = mysql_query($query) or die(mysql_error()); if(isset($res)){ header("location: buildings.php"); } }else{ $buildingsInfo = $row; $ioutput = ($row['ironbaseoutput']*$row['ironminelevel']*700); $poutput = ($row['platbaseoutput']*$row['platminelevel']*700); $eoutput = ($row['solarbaseoutput']*$row['solarminelevel']*10); $feoutput = ($row['fusionbaseoutput']*$row['fusionminelevel']*100); $uuoutput = ($row['recruitbaseoutput']*$row['recruitminelevel']*100); } ?> <form method="POST" action="" name="submit_iron_build"> <div id="IronMine" style="background-image:url('src_img/IronMine.png');width:519px;height:156px;"> <img src="src_img/IM.png" id="IM" onmouseover="tooltip.show('<center><h3><span>Iron Mine</span></h3><b>Iron Produced per cycle: <span><?php echo number_format($ioutput);?></span> units<br /></b></center>');" onmouseout="tooltip.hide();" /> <div id="IIronPrice"><?php if($buildingsInfo['ironminelevel']<=0){ echo number_format($buildingsInfo['ironbaseprice1']);}else{echo number_format($buildingsInfo['ironbaseprice1']*$buildingsInfo['ironminelevel']*200);}?> Units</div> <div id="IPlatinumPrice"><?php if($buildingsInfo['ironminelevel']<=0){ echo number_format($buildingsInfo['ironbaseprice2']);}else{echo number_format($buildingsInfo['ironbaseprice2']*$buildingsInfo['ironminelevel']*200);}?> Units</div> <div id="IEnergyPrice"><?php if($buildingsInfo['ironminelevel']<=0){ echo number_format($buildingsInfo['ironbaseprice3']);}else{echo number_format($buildingsInfo['ironbaseprice3']*$buildingsInfo['ironminelevel']*200);}?> Units</div> <div id="ILevel">(<?php echo number_format($buildingsInfo['ironminelevel']);?>)</div> <div id="UpgradeIronMine" ><input type="submit" name="UPGIron" id="UPGIron" value="" /></div> </div> </form> <form method="POST" action="" name="submit_plat_build"> <div id="PlatMine" style="background-image:url('src_img/PlatinumMine.png');width:519px;height:156px;"> <img src="src_img/PM.png" id="PM" onmouseover="tooltip.show('<center><h3><span>Platinum Mine</span></h3><b>Platinum Produced per cycle: <span><?php echo number_format($poutput);?></span> units<br /></b></center>');" onmouseout="tooltip.hide();" /> <div id="PIronPrice"><?php if($buildingsInfo['platminelevel']<=0){ echo number_format($buildingsInfo['platbaseprice1']);}else{echo number_format($buildingsInfo['platbaseprice1']*$buildingsInfo['platminelevel']*200);}?> Units</div> <div id="PPlatinumPrice"><?php if($buildingsInfo['platminelevel']<=0){ echo number_format($buildingsInfo['platbaseprice2']);}else{echo number_format($buildingsInfo['platbaseprice2']*$buildingsInfo['platminelevel']*200);}?> Units</div> <div id="PEnergyPrice"><?php if($buildingsInfo['platminelevel']<=0){ echo number_format($buildingsInfo['platbaseprice3']);}else{echo number_format($buildingsInfo['platbaseprice3']*$buildingsInfo['platminelevel']*200);}?> Units</div> <div id="PLevel">(<?php echo number_format($buildingsInfo['platminelevel']);?>)</div> <div id="UpgradeIronMine" ><input type="submit" name="UPGPlat" id="UPGPlat" value="" /></div> </div> </form> <form method="POST" action="" name="submit_solar_build"> <div id="SolarMine" style="background-image:url('src_img/SolarPanels.png');width:519px;height:156px;"> <img src="src_img/SP.png" id="SP" onmouseover="tooltip.show('<center><h3><span>Solar Panels</span></h3><b>Energy Produced per cycle: <span><?php echo number_format($eoutput);?></span> units<br /></b></center>');" onmouseout="tooltip.hide();" /> <div id="SIronPrice"><?php if($buildingsInfo['solarminelevel']<=0){ echo number_format($buildingsInfo['solarbaseprice1']);}else{echo number_format($buildingsInfo['solarbaseprice1']*$buildingsInfo['solarminelevel']*200);}?> Units</div> <div id="SPlatinumPrice"><?php if($buildingsInfo['solarminelevel']<=0){ echo number_format($buildingsInfo['solarbaseprice2']);}else{echo number_format($buildingsInfo['solarbaseprice2']*$buildingsInfo['solarminelevel']*200);}?> Units</div> <div id="SEnergyPrice"><?php if($buildingsInfo['solarminelevel']<=0){ echo number_format($buildingsInfo['solarbaseprice3']);}else{echo number_format($buildingsInfo['solarbaseprice3']*$buildingsInfo['solarminelevel']*200);}?> Units</div> <div id="SLevel">(<?php echo number_format($buildingsInfo['solarminelevel']);?>)</div> <div id="UpgradeSolarMine" ><input type="submit" name="UPGSolar" id="UPGSolar" value="" /></div> </div> </form> <?php if($buildingsInfo['solarminelevel']>=15){ ?> <form method="POST" action="" name="submit_fusion_build"> <div id="FusionMine" style="background-image:url('src_img/FusionFacility.png');width:519px;height:156px;" onmouseover="tooltip.show('<center><h3><span>Fusion Facility</span></h3><b>Energy Produced per cycle: <span><?php echo number_format($feoutput);?></span> units<br /></b></center>');" onmouseout="tooltip.hide();"> <div id="FIronPrice"><?php if($buildingsInfo['fusionminelevel']<=0){ echo number_format($buildingsInfo['fusionbaseprice1']);}else{echo number_format($buildingsInfo['fusionbaseprice1']*$buildingsInfo['fusionminelevel']*600);}?> Units</div> <div id="FPlatinumPrice"><?php if($buildingsInfo['fusionminelevel']<=0){ echo number_format($buildingsInfo['fusionbaseprice2']);}else{echo number_format($buildingsInfo['fusionbaseprice2']*$buildingsInfo['fusionminelevel']*600);}?> Units</div> <div id="FEnergyPrice"><?php if($buildingsInfo['fusionminelevel']<=0){ echo number_format($buildingsInfo['fusionbaseprice3']);}else{echo number_format($buildingsInfo['fusionbaseprice3']*$buildingsInfo['fusionminelevel']*600);}?> Units</div> <div id="FLevel">(<?php echo number_format($buildingsInfo['fusionminelevel']);?>)</div> <div id="UpgradeFusionMine" ><input type="submit" name="UPGFusion" id="UPGFusion" value="" /></div> </div> </form> <?}?> <form method="POST" action="" name="submit_recruit_build"> <div id="RecruitMine" style="background-image:url('src_img/RecruitmentCenter.png');width:519px;height:156px;" onmouseover="tooltip.show('<center><h3><span>Recruitment Center</span></h3><b>Unplaced Citizen per cycle: <span><?php echo number_format($uuoutput);?></span> units<br /></b></center>');" onmouseout="tooltip.hide();" > <div id="RIronPrice"><?php if($buildingsInfo['recruitminelevel']<=0){ echo number_format($buildingsInfo['recruitbaseprice1']);}else{echo number_format($buildingsInfo['recruitbaseprice1']*$buildingsInfo['recruitminelevel']*600);}?> Units</div> <div id="RPlatinumPrice"><?php if($buildingsInfo['recruitminelevel']<=0){ echo number_format($buildingsInfo['recruitbaseprice2']);}else{echo number_format($buildingsInfo['recruitbaseprice2']*$buildingsInfo['recruitminelevel']*600);}?> Units</div> <div id="REnergyPrice"><?php if($buildingsInfo['recruitminelevel']<=0){ echo number_format($buildingsInfo['recruitbaseprice3']);}else{echo number_format($buildingsInfo['recruitbaseprice3']*$buildingsInfo['recruitminelevel']*600);}?> Units</div> <div id="RLevel">(<?php echo number_format($buildingsInfo['recruitminelevel']);?>)</div> <div id="UpgradeRecruitMine" ><input type="submit" name="UPGRecruit" id="UPGRecruit" value="" /></div> </div> </form> <form method="POST" action="" name="submit_shipyard_build"> <div id="ShipyardMine" style="background-image:url('src_img/ShipYard.png');valign:center;width:519px;height:156px;"> <div id="ShIronPrice"><?php echo number_format($buildingsInfo['shipyardbaseprice1']);?> Units</div> <div id="ShPlatinumPrice"><?php echo number_format($buildingsInfo['shipyardbaseprice2']);?> Units</div> <div id="ShEnergyPrice"><?php echo number_format($buildingsInfo['shipyardbaseprice3']);?> Units</div> <div id="ShLevel">(<?php echo number_format($buildingsInfo['shipyardminelevel']);?>)</div> <div id="UpgradeShipyardMine" ><input type="submit" name="UPGShipyard" id="UPGShipyard" value="" /></div> </div> </form> </div> </body> </html>
  18. Wow I took them out and it worked! You are awesome my friend!
  19. why not? I have been doing that for quite some time and never had a problem untill now.
  20. Ok Here is the query: $q = "INSERT INTO `reff` SET 'firstName' = '{$fname}', 'hear' = '{$ham}', 'message' = '{$message}';"; You have an error in your [url="http://brianflores.capnix.com/reference.php#"]SQL syntax[/url]; check the manual that corresponds to your MySQL server version for the right syntax to use near ''firstName' = 'Brian', 'hear' = 'A very good friend', 'message' = 'This guys is ' at line 1[img=http://aa.static.facdn.com/v/img/1x1.gif][img=http://itxt.couponamazing.com/hks?p=YTE5Mjc4MjEzNDMa6b7v3%2BLEp4s6FVfyskw0iVDTmqQSXmPAEC8Hw43ge8fe5NagbigAIYsDISQSP0H0BQRGbXWUL2PKkZLqiLVV6dPwxy5STlOx34PA25H8NeGqTxCZEdhU%2ByioyrZdEFPk1719cRk2AA1R846Kl2%2B9&cks=YTQyMjE1MDgzOTPXBuoFUIKsUIPnglqbzUOkqLjrr4I3GQE%2BG%2B2FdQoF4A36DN8UaieULOFlK174dLl413sY%2F8Ez3Q%3D%3D&t=1][img=http://itxt.couponamazing.com/acttr?v=1&a=te_trck_old%3A%091%09FP15&t=1360627629078][img=http://itxt.couponamazing.com/acttr?v=1&a=te_trck_new%3A%092%090%09FP15&t=1360627629079]
  21. Ok I am getting this error: Deprecated: Function sql_regcase() is deprecated in /home/u309930328/public_html/funcvars/libfunc.php on line 17 Deprecated: Function sql_regcase() is deprecated in /home/u309930328/public_html/funcvars/libfunc.php on line 17 Deprecated: Function sql_regcase() is deprecated in /home/u309930328/public_html/funcvars/libfunc.php on line 17 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''firstName', 'hear', 'message') VALUES('', '', '')' at line 1 from this code: INSERT INTO reff ('firstName', 'hear', 'message') VALUES('{$fname}', '{$ham}', '{$message}');
  22. Thanks guys but I put up a subdomain with a copy of the site in different languages so each language has it's own subdomain and it works sufficiently. But I do like the debugging setup you have there Psycho thanks guys.
  23. hmm I can't figure this out. weird as heck
×
×
  • 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.