Welcome to Dream.In.Code
Become a PHP Expert!

Join 136,930 PHP Programmers for FREE! Get instant access to thousands of PHP experts, tutorials, code snippets, and more! There are 1,836 people online right now. Registration is fast and FREE... Join Now!




kick?

 
Reply to this topicStart new topic

kick?, login page just says kick...

B-Boy209
19 Mar, 2008 - 10:09 AM
Post #1

D.I.C Head
**

Joined: 9 Dec, 2007
Posts: 61


My Contributions
okay...so i know how it is about mafia games and all but i have one...and im new to this php thing...by the way sorry if this isnt the right place for this and since the problem has to do with php i put here...but any way when i go to the login page for the new round and start playing it just shows a blank white page and it says kick...anyone have any guess why...???
User is offlineProfile CardPM
+Quote Post

PsychoCoder
RE: Kick?
19 Mar, 2008 - 10:11 AM
Post #2

using DIC.Core;
Group Icon

Joined: 26 Jul, 2007
Posts: 8,998



Thanked: 126 times
Dream Kudos: 8625
Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net

My Contributions
Is this a site you're creating/created, or just a site on the internet where you play the game?
User is offlineProfile CardPM
+Quote Post

B-Boy209
RE: Kick?
19 Mar, 2008 - 10:12 AM
Post #3

D.I.C Head
**

Joined: 9 Dec, 2007
Posts: 61


My Contributions
well i didnt create it i got the script from a friend but i cant get it to work...
User is offlineProfile CardPM
+Quote Post

PsychoCoder
RE: Kick?
19 Mar, 2008 - 10:18 AM
Post #4

using DIC.Core;
Group Icon

Joined: 26 Jul, 2007
Posts: 8,998



Thanked: 126 times
Dream Kudos: 8625
Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net

My Contributions
Why don't you post the code so we can see it, and maybe debug it for you. Use code tags when posting the code code.gif smile.gif
User is offlineProfile CardPM
+Quote Post

B-Boy209
RE: Kick?
19 Mar, 2008 - 10:23 AM
Post #5

D.I.C Head
**

Joined: 9 Dec, 2007
Posts: 61


My Contributions
CODE
<?
include("html.php");

if($switch==game){ $code==$trupimpn; }

if(fetch("SELECT round FROM $tab[games] WHERE round='$tru' AND starts<$time AND ends>$time;"))
  {
  $pimp =mysql_fetch_array(mysql_query("SELECT id,code,status,user FROM $tab[pimp] WHERE code='$code';"));

      if ($pimp[2] == banned){ header("Location: ../play.php?msg=disabled"); }
  elseif ($pimp[0])
         {
         mysql_query("UPDATE $tab[pimp] SET online='$time', ip='$REMOTE_ADDR' WHERE id='$pimp[0]'");

         setcookie("trupimpn",$pimp[1]);

         header("Location: index.php?tru=$tru");
         }
    else { header("Location: ../play.php?msg=select"); }

  }else{ echo"kick"; //header("Location: ../play.php?msg=select");
}

?>  
thats where the problem is...first it gave the error ... Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/username/public_html/tru/dologin.php on line 8... but then i changed the $tab[game] to $tab[games] and thats when it said kick if i take the $tab[games] and just make it $tab[game] it shows the error again but i guess that $tab[game] wasnt the problem but i dont see whats wrong with line 8 either... sad.gif

This post has been edited by B-Boy209: 19 Mar, 2008 - 10:40 AM
User is offlineProfile CardPM
+Quote Post

Martyr2
RE: Kick?
19 Mar, 2008 - 11:56 AM
Post #6

Programming Theoretician
Group Icon

Joined: 18 Apr, 2007
Posts: 5,231



Thanked: 220 times
Expert In: C/C++, Java, VB, VB.NET, C#, PHP, Web Development, HTML & CSS, Javascript

My Contributions
First of all you need to change this line...

php

// Change this...
if($switch==game){ $code==$trupimpn; }

// To this...

if ($switch=="game"){ $code = $trupimpn; }


Then make sure you have $tab[games] because that is working, your warning is coming on the following line there where you go to set $pimp.

You execute the statement SELECT id,code,status,user FROM $tab[pimp] WHERE code='$code'; so you need to check this out if it is correct. First of all, what will $tab[pimp] return? Is that a valid table? Then make sure that the table returned has the fields id, code, status and user. If it doesn't have all those fields, it will fail. Lastly, make sure that $code is coming out to be a value. By correcting this query you should get much much closer to it working for you.

Make the changes and let us know what happens. smile.gif
User is online!Profile CardPM
+Quote Post

B-Boy209
RE: Kick?
19 Mar, 2008 - 06:47 PM
Post #7

D.I.C Head
**

Joined: 9 Dec, 2007
Posts: 61


My Contributions
well i tried what you said checked the tables and they were there...only thing i dont get is what do you mean that make sure that $code is coming out to be a value...is there anyway that the problem could be elsewhere...???
User is offlineProfile CardPM
+Quote Post

_net
RE: Kick?
19 Mar, 2008 - 08:40 PM
Post #8

D.I.C Head
**

Joined: 22 Sep, 2007
Posts: 146


My Contributions
Its hard debugging scripts like this. I've tried to debug a mafia game and damn it took awhile. Hope yours is not as messy as mine is/was.
User is offlineProfile CardPM
+Quote Post

B-Boy209
RE: Kick?
19 Mar, 2008 - 08:42 PM
Post #9

D.I.C Head
**

Joined: 9 Dec, 2007
Posts: 61


My Contributions
yeah i hope its not as well because im already stressed as it is...but i like it kind of because its helping me learn...but im also trying to get the game up so thats the reason for the frustration...
User is offlineProfile CardPM
+Quote Post

_net
RE: Kick?
19 Mar, 2008 - 08:52 PM
Post #10

D.I.C Head
**

Joined: 22 Sep, 2007
Posts: 146


My Contributions
Thats good, Games are good way to learn (programming wise). If you were to write algorithms and complex functions, it would be pretty stressful and boring if you are new, but the game gives some sort of motivation lol. It did to me, I was just excited to get it up and running so I fought the frustration smile.gif

So anyways, what is this script called, I might take a look inside or find some other reviews of it.
User is offlineProfile CardPM
+Quote Post

B-Boy209
RE: Kick?
19 Mar, 2008 - 08:57 PM
Post #11

D.I.C Head
**

Joined: 9 Dec, 2007
Posts: 61


My Contributions
dont know what the script is called...but ill send you a pm if youd like to see if you know who might of written it...
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/3/08 10:36PM

Live PHP Help!

PHP Tutorials

Reference Sheets

PHP Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month