TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   General (http://www.talkphp.com/general/)
-   -   Having trouble!!! (http://www.talkphp.com/general/3927-having-trouble.html)

KingOfTheSouth 01-31-2009 07:02 AM

Having trouble!!!
 
1 Attachment(s)
Hey everyone I am having trouble with a page I added a lot of stuff to. I work on this page for about an hour and a half and I thought I had it correct. But I finished I sold a few items on the page and changed the page and then i lost all the money I just made selling the items. But I do not know what the problem is. It is way too big to post here so I will upload it. Please I am a pimp in dis stress lol I need it fixed and I do not know how to to fix it

Wildhoney 01-31-2009 02:10 PM

That's huge! What's broken exactly? What doesn't it do?

Village Idiot 02-01-2009 09:31 PM

Yeah, we can't be expected to get acquainted with, test and debug all that. Give us so more so we can help you.

KingOfTheSouth 02-02-2009 01:11 AM

Well is the calls to the database I am pretty sure and what it does when you sell items on the page it takes the items but does not give you the cash.

Village Idiot 02-02-2009 03:30 AM

But what is the exact issue you are facing?

KingOfTheSouth 02-02-2009 08:38 PM

I said it in my last post. But I am pretty sure it is within here
PHP Code:

<?
if (($buy) || ($sell))
{
      if ((
maxlength($condoms) == bad) ||
          (
maxlength($meds) == bad) ||
          (
maxlength($glocks) == bad) ||
          (
maxlength($shotguns) == bad) ||
          (
maxlength($uzis) == bad) ||
          (
maxlength($ak47s) == bad) ||
          (
maxlength($crack) == bad) ||
          (
maxlength($dope) == bad) ||
          (
maxlength($lowriders) == bad) ||
          (
maxlength($hummer) == bad) ||
          (
maxlength($jet) == bad) ||
          (
maxlength($plane) == bad))
          {
$error='<font color="#FFCC00">You cannot buy or sell that amount at a time</font>';}
  elseif ((
$condoms) && (eregi_replace("([0-9]+)","",$condoms)) ||
        (
$meds) && (eregi_replace("([0-9]+)","",$meds)) ||
        (
$glocks) && (eregi_replace("([0-9]+)","",$glocks)) || 
        (
$shotguns) && (eregi_replace("([0-9]+)","",$shotguns)) ||
        (
$uzis) && (eregi_replace("([0-9]+)","",$uzis)) ||
        (
$ak47s) && (eregi_replace("([0-9]+)","",$ak47s)) ||
        (
$crack) && (eregi_replace("([0-9]+)","",$crack)) ||
        (
$dope) && (eregi_replace("([0-9]+)","",$dope)) ||
        (
$lowriders) && (eregi_replace("([0-9]+)","",$lowriders)) ||
        (
$hummer) && (eregi_replace("([0-9]+)","",$hummer)) ||
        (
$jet) && (eregi_replace("([0-9]+)","",$jet)) ||
        (
$plane) && (eregi_replace("([0-9]+)","",$plane))) {?><font color="#FFCC00">No item selected</font><br><?}
   else{
       if(
$buy)
         {
$price1=$condoms*5;
          
$price2=$meds*20;
          
$price4=$glocks*500;
          
$price5=$shotguns*1000;
          
$price6=$uzis*2500;
          
$price7=$ak47s*5000;
          
$price8=$crack*20;
          
$price9=$dope*10;
          
$price10=$lowriders*8000;
          
$price11=$hummer*16000;
          
$price12=$jet*50000;
          
$price13=$plane*125000;
         }
       if(
$sell)
         {
$price6=$glocks*375;
          
$price7=$shotguns*750;
          
$price8=$uzis*1875;
          
$price9=$ak47s*3750;
          
$price10=$condoms*3.75;
          
$price11=$crack*15;
          
$price12=$dope*7.5;
          
$price13=$meds*15;
          
$price14=$lowrider*6000;
          
$price15=$hummer*12000;
          
$price16=$jet*37500;
          
$price17=$plane*93750;
         }


Or here
PHP Code:

 if($buy)
             {
$pmp[6] -= $cost;
              
$pmp[6] += $condoms;
              
$pmp[7] += $meds;
              
$pmp[9] += $crack;
              
$pmp[8] += $dope;
              
$pmp[1] += $glocks;
              
$pmp[2] += $shotguns;
              
$pmp[3] += $uzis;
              
$pmp[4] += $ak47s;
              
$pmp[5] += $lowriders;}
              
$pmp[10] += $hummer;}
              
$pmp[11] += $jet;}
              
$pmp[12] += $plane;}
           if(
$sell)
             {
$pmp[6] += $cost;
              
$pmp[1] -= $glocks;
              
$pmp[2] -= $shotguns;
              
$pmp[3] -= $uzis;
              
$pmp[4] -= $ak47s;
              
$pmp[5] -= $lowriders;
              
$pmp[10] -= $hummer;
              
$pmp[11] -= $jet;
              
$pmp[12] -= $plane;
              
$pmp[6] -= $condoms;
              
$pmp[7] -= $meds;
              
$pmp[9] -= $crack;
              
$pmp[8] -= $dope;
             }
           
$pmp[1]=fixinput($pmp[1]);
           
$pmp[2]=fixinput($pmp[2]);
           
$pmp[3]=fixinput($pmp[3]);
           
$pmp[4]=fixinput($pmp[4]);
           
$pmp[5]=fixinput($pmp[5]);
           
$pmp[6]=fixinput($pmp[6]);
           
$pmp[7]=fixinput($pmp[7]);
           
$pmp[8]=fixinput($pmp[8]);
           
$pmp[9]=fixinput($pmp[9]);
           
$pmp[10]=fixinput($pmp[10]);
           
$pmp[11]=fixinput($pmp[11]);
           
$pmp[12]=fixinput($pmp[12]);
           
$pmp[13]=fixinput($pmp[13]);
           
mysql_query("UPDATE $tab[pimp] SET money='$pmp[6]', condom='$pmp[6]', medicine='$pmp[7]', crack='$pmp[9]', weed='$pmp[8]', glock='$pmp[1]', shotgun='$pmp[2]', uzi='$pmp[3]', ak47='$pmp[4]', lowrider='$pmp[5]', hummer='$pmp[10]', jet='$pmp[11]', plane='$pmp[12]' WHERE id='$id'");
           
$soldfor=$pmp[6];
           
$transaction=completed

I pretty much copy and pasted a few other lines to add the stuff since this page is the most complicated in the whole script

CoryMathews 02-03-2009 12:00 AM

ok so you know where it is. Why don't you try outputing everything right before it gets inserted into the db. Then see what actually gets to the database. Then that should tell you where the problem is.

KingOfTheSouth 02-04-2009 04:53 AM

1 Attachment(s)
That did not work but check this out. I added numbers to everything that is supposed to be numbered to help everyone out with this. Here is the new file. Notice that there is numbers above the first query but they are commented out. The numbers edited above the query are to show which number goes with each item.
Thanks,

Scottymeuk 02-05-2009 07:07 PM

Wow that amount of coding is scary on one page like that.

What does it actually do. Does it give out an error? or what? If it does not post the form it may have something to do with

PHP Code:

if($keyboard == enter

I don't see that set anywhere.

KingOfTheSouth 02-05-2009 09:05 PM

It does not give out an error. It goes to a game. In the game you can buy items such as your drugs vehicles and weapons. But I added three new vehicles to the game and it will not give you the items or cash when you purchase the items or sell the items.

Wildhoney 02-05-2009 09:13 PM

Well, there's always Watchdog.

KingOfTheSouth 02-05-2009 09:15 PM

What does that really have to do with a game?

Scottymeuk 02-05-2009 11:53 PM

Its a joke lol. You said you dont get the goods when you purchase it. Therefor complain to watchdog lol.

Anyway, back on topic. What 3 items did you add? (Give the vars)

KingOfTheSouth 02-06-2009 01:17 AM

It was the Hummer, Jet, Plane, so in other words it is Hummer, Private Jet, Commercial Plane


All times are GMT. The time now is 04:34 AM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0