Closed Thread
Results 1 to 4 of 4




  

Thread: need help with php page

      
  1. #1
    Jedi Master bikerboys is on a distinguished road
    Join Date
    August 29, 2007
    Location
    usa
    Posts
    25
    Rep Power
    5
    Feedback Score
    0

    Default need help with php page

    have this page below it is from a mafia game im building but i had to add a few more of the men to it and it seems that it will still only find the original ones that were there witch are thugs and hoes

    im thinking that i have to add this
    PHP Code:
    if($turn_total 0){ $error="You dont have enough turns!"; }
      else{ 
    $bugfix=fixed
    to each part here
    PHP Code:
    if ($area == 'casino')
      {
       
    $unit1 'whores';
       
    $unit2 'card dealers';
        
    mysql_query("UPDATE $tab[pimp] SET turn='$turn_total', hoes='$hoe_total+$hoetl, dealers=dealers+$thugtl, protection='$protect', protectstarted='$time' WHERE id='$id'");
      }
     elseif (
    $area == 'cafe')
      {
       
    $unit1 'hitmen';
       
    $unit2 'hustlers';
        
    mysql_query("UPDATE $tab[pimp] SET turn='$turn_total', hitmen=hitmen+$hoetl, hustlers=hustlers+$thugtl, protection='$protect', protectstarted='$time' WHERE id='$id' AND rid='$rid'"); 
      }
     elseif (
    $area == 'ghetto')
      {
       
    $unit1 'bootleggers';
       
    $unit2 'punks';
        
    mysql_query("UPDATE $tab[pimp] SET turn='$turn_total', bootleggers=bootleggers+$hoetl, punks=punks+$thugtl, protection='$protect', protectstarted='$time' WHERE id='$id' AND rid='$rid'"); 
      }
     elseif (
    $area == 'gym')
      {
       
    $unit1 'bodyguards';
       
    $unit2 'thugs';
        
    mysql_query("UPDATE $tab[pimp] SET turn='$turn_total', bodyguards=bodyguards+$hoetl, thug=thug+$thugtl, protection='$protect', protectstarted='$time'  WHERE id='$id' AND rid='$rid'"); 
      }
     else
      {
       echo 
    'Please select an area.';
      } 
    but im not real sure any ideas would be great thanks much for the help



    PHP Code:
    <?
    include("game_html.php");$game="yes";
    mysql_query("UPDATE $tab[pimp] SET currently='scouting for hoes', online='$time' WHERE id='$id' AND rid='$rid'");
    $user = mysql_fetch_array(mysql_query("SELECT turn,cash,thugs,hoes,medicine,lowrider,bootleggers,bodyguards,hitmen,hustlers,dealers,punks FROM $tab[pimp] WHERE id='$id' AND rid='$rid';"));
    if (isset($_REQUEST["keyboard"])) $keyboard=$_REQUEST["keyboard"]; else $keyboard="";
    if (isset($_REQUEST["area"])) $area=$_REQUEST["area"]; else $area="";
    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(!is_numeric($turns) || $turns < 0){$error="<br>You didn't enter a (valid)number!";$turns = 0;}
        elseif($turns>= 2001){$error="<br>you can only use up to 2000 turns!"; $turns = 0;}
     
        else {
             srand ((double) microtime() * 1000000);
             //WHORE SCOUT
             $scouts=$turns;
             while ($scouts>0){
                       if($scouts > 25){
                          $hoe=round($hoe+(rand(10,25)));$thug=round($thug+(rand(5,10)));
                          $scouts=($scouts-30);
                         }
                   elseif($scouts >= 10){
                          $hoe=round($hoe+(rand(5,10)));$thug=round($thug+(rand(1,5)));
                          $scouts=($scouts-10);
                         }
                   elseif($scouts >= 5){
                          $hoe=round($hoe+(rand(1,5)));$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);
                         }
             }
        $randevent=rand(0,225);
        $event="";
        if($randevent==0){ $bribe=losecash($id); if($bribe>$user["cash"]){$bribe=$user["cash"];} $bribec=commas($bribe); if($bribe!=0){ $event="FREEZE!!! you are under arrest for prostitution, you bribe the cops with $$bribec."; } }
    //    if($randevent==25){ $lowrider=1; $event="You come across a lowrider, and notice the keys are in it..."; }
        if($randevent==50){ $cash=losecash($id); $cashc=commas($cash); if($cash!=0){ $event="One of your *****es trip over a lump of **** and drops $$cashc!"; } }
        if($randevent==75){ $gang=round($user["thugs"]*.05); if($gang>$user["thugs"]){$gang=$user["thugs"];} $gangc=commas($gang); if($gang!=0){ $event="Out of no where, a gang of thugs start shooting at you, $gangc thugs where killed."; } }
    //    if($randevent==100){ $event="Congradulations! You have just won $won from they lottery!"; }
        if($randevent==125){ $gram=round($user["thugs"]*1.5); $gramc=commas($gram); if($gram!=0){ $event="On the way home, you came across $gramc grams of weed!"; } }
        if($randevent==150){ $overdose=round($user["hoes"]*.01); if($overdose!=0){ $overdosec=commas($overdose); $event="$overdosec hoes smoked to much cracked and overdosed!"; } }
        if($randevent==175){ $medicine=round($user["medicine"]*.10); if($medicine>$user["medicine"]){$medicine=$user["medicine"];}$medicinec=commas($medicine); if($medicine!=0){ $event="10% of your hoes where infected with herpes, your hoes use $medicinec boxs of medicine"; } }
    //    if($randevent==225){ $noobbomb=1; $event="While scouting for hoes, you come across a noob bomb???"; }
        $bonus=(($user["thugs"]/$hoebonus)+1);
        $hoe=round($hoe*$bonus);
        $thug=round($thug*$bonus);
      $hoetl=fixinput($hoes); 
        $thugtl=fixinput($thugs);
        $randarea=rand(1,5);
        if($randarea==$area){ $bonushoe=round(5*$bonus); $bonusthug=round(2*$bonus); }
        useresources($turns);
        $infected=medicine($turns);
        $killbystd=nomedicine($turns);
        $cashmade=cash($turns);
        $thugleft=unhappy("thugs",$turns,$bonus);
        $hoeleft=unhappy("hoes",$turns,$bonus);
        $user = mysql_fetch_array(mysql_query("SELECT lowrider,hoes,thugs,cash,ak47,weed,turn,medicine,noobbomb,bootleggers,bodyguards,hitmen,hustlers,dealers,punks FROM $tab[pimp] WHERE id='$id' AND rid='$rid';"));
        $hoe_total = fixinput($user["hoes"]+$hoe+$bonushoe-$killbystd-$hoeleft-$overdose); 
        $thug_total = fixinput($user["thugs"]+$thug+$bonusthug-$thugleft-$gang);
        $cash_total = fixinput($user["cash"]+$cashmade-$bribe+$cash);
        $weed_total = fixinput($user["weed"]+$gram);
        $meds_total = fixinput($user["medicine"]-$medicine);
     
        $turn_total = $user["turn"]-$turns;
        if($turns >= 60){$protect=60;}else{$protect=$turns;}
        $noobbomb = $user["noobbomb"]+$noobbomb;
        if($turn_total < 0){ $error="You dont have enough turns!"; }
      else{ $bugfix=fixed; mysql_query("UPDATE $tab[pimp] SET turn='$turn_total', weed='$weed_total', cash='$cash_total', hoes='$hoe_total+$hoetl', thugs='$thug_total+$thugtl', protection='$protect', protectionstart='$time', medicine='$meds_total', noobbomb='$noobbomb' WHERE id='$id' AND rid='$rid'"); }
    if ($area == 'casino')
      {
       $unit1 = 'whores';
       $unit2 = 'card dealers';
        mysql_query("UPDATE $tab[pimp] SET turn='$turn_total', hoes='$hoe_total+$hoetl, dealers=dealers+$thugtl, protection='$protect', protectstarted='$time' WHERE id='$id'");
      }
     elseif ($area == 'cafe')
      {
       $unit1 = 'hitmen';
       $unit2 = 'hustlers';
        mysql_query("UPDATE $tab[pimp] SET turn='$turn_total', hitmen=hitmen+$hoetl, hustlers=hustlers+$thugtl, protection='$protect', protectstarted='$time' WHERE id='$id' AND rid='$rid'"); 
      }
     elseif ($area == 'ghetto')
      {
       $unit1 = 'bootleggers';
       $unit2 = 'punks';
        mysql_query("UPDATE $tab[pimp] SET turn='$turn_total', bootleggers=bootleggers+$hoetl, punks=punks+$thugtl, protection='$protect', protectstarted='$time' WHERE id='$id' AND rid='$rid'"); 
      }
     elseif ($area == 'gym')
      {
       $unit1 = 'bodyguards';
       $unit2 = 'thugs';
        mysql_query("UPDATE $tab[pimp] SET turn='$turn_total', bodyguards=bodyguards+$hoetl, thug=thug+$thugtl, protection='$protect', protectstarted='$time'  WHERE id='$id' AND rid='$rid'"); 
      }
     else
      {
       echo 'Please select an area.';
      }
        $worth=worth($id);$wappy=hoehappy($id);$tappy=thughappy($id);
        mysql_query("UPDATE $tab[pimp] SET hoehappy='$wappy', thughappy='$tappy',worth='$worth', online='$time' WHERE id='$id' AND rid='$rid'");
        }
    }
     
    $user = mysql_fetch_array(mysql_query("SELECT status,hoehappy,thughappy FROM $tab[pimp] WHERE id='$id' AND rid='$rid';"));
    secureheader();
    ?>
    <form method="post" action="scout.php?rid=<?=$rid?>">
    <font size="+1"><b>scout for hoes</b></font>
    <br><b><font color="#B5CDE6">get them *****es out on the corner!</font></b>
    <br><font color="#FFCC00"><?=$error?></font><br>
    <?if(($keyboard=="enter") && ($bugfix == fixed)){?>
    <nobr>
    <?if($event){?><br><font color="#B5CDE6"><?=$event?></font><?}?>
    <br>using <font color="3366FF"><?=$trn?></font> turns, you found a total of <font color="#3366FF"><?=commas($hoe)?></font> <?= $unit1?> and  found <font color="#3366FF"><?=commas($thug)?></font> <?=$unit2?>. 
    <br>your hoes returned with them <font color="#B5CDE6"><b>$<?=commas($cashmade)?></b></font> in <b>cash</b>
    </nobr>
    <br>
    <br>
    <?}?>
    <br>use <input type="text" class="text" maxlength="3" size="5" name="turns" value="<?if($turns){echo"$turns";}?>"> turns pimp'n your hoes.</b>
    <br>scout around <select name="area">
      <option value="casino" <?PHP if($area == "casino") print("selected");?>>Casino(Whores and Card Dealers)</option>
      <option value="cafe" <?PHP if($area == "cafe") print("selected");?>>Caffe Napoli(Hitmen and Hustlers)</option>
      <option value="ghetto" <?PHP if($area == "ghetto") print("selected");?>>Ghetto(Bootleggers and Punks)</option>
      <option value="gym" <?PHP if($area == "gym") print("selected");?>>Gym(Thugs and Bodyguards)</option>
     </select>
    <br>
    <br><input type="hidden" name="keyboard" value="enter"><input type="submit" class="submit" name="scout" value="scout">
    <br>
    <br><small>hoe happiness: <font color="#FFCC00"><?=$user["hoehappy"]?>%</font> &nbsp; thug happiness: <font color="#FFCC00"><?=$user["thughappy"]?>%</font></small>
    </form>
    <?if(($user["status"] != 1) && ($user["status"] != 2)){?>
    <small><font color="#FFCC00">Supporters Only:</font> set default scout turns
    <br><a href="credits.php">learn more about becoming a supporter and supporter features</a>
    </small>
    <?}?>
    <br>
    <br>
    <?=bar()?>
    <br>
    <?
    gamefooter();
    unset($user);
    ?>

  2. #2
    I'm New! gedan is on a distinguished road
    Join Date
    August 24, 2007
    Posts
    17
    Rep Power
    5
    Feedback Score
    0

    Default

    What is the return error?
    If the script is old (PHP3) =>
    In PHP4 the register globals is setup to off
    to correct this, add in the script

    foreach($_POST AS $key => $value) {
    ${$key} = $value;
    }

    foreach($_GET AS $key => $value) {
    ${$key} = $value;
    }

  3. #3
    Jedi Master bikerboys is on a distinguished road
    Join Date
    August 29, 2007
    Location
    usa
    Posts
    25
    Rep Power
    5
    Feedback Score
    0

    Default

    and were inthe script would i add this

  4. #4
    I'm New! gedan is on a distinguished road
    Join Date
    August 24, 2007
    Posts
    17
    Rep Power
    5
    Feedback Score
    0

    Default

    Quote Originally Posted by bikerboys View Post
    and were inthe script would i add this
    Put in the start,
    after of <?

    Do test
    If don't work removes

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Page 2 for my keywords!
    By WeedGrinch in forum MSN
    Replies: 7
    Last Post: Nov 26th, 2010, 2:18 am
  2. Replies: 7
    Last Post: Mar 18th, 2008, 8:21 am
  3. Top of page button
    By stefanie in forum Feedback and Support
    Replies: 5
    Last Post: Jan 23rd, 2008, 5:23 am
  4. Replies: 25
    Last Post: Jun 22nd, 2007, 3:21 pm

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
WebTalkForums
WebTalkForums
Recent Forum Threads