Jump to content

dark dude

Members
  • Posts

    53
  • Joined

  • Last visited

    Never

Everything posted by dark dude

  1. mysql_query("UPDATE mp3 SET {whichever field holds the band name}='{bandname variable here}', {whichever field holds the song name}='{songname variable here}' WHERE userid = '$bandid'"); might work... I dnno, try it and tell us what happens... And btw, slightly offtopic, but good example band + song given thar :P
  2. Is there any way to prevent my Php script from placing numbers into Standard Form when they exceed a certain point?
  3. Thanks AndyB and Crayon Violet, that worked perfectly. I see why you guys are Global Mods ^^
  4. Not sure if this might work, but have you tried using the <META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE"> html tag?
  5. I'm having some problems with this: [code]$DefBody = '[Some irrelevant code/] <tr><td>Halo Moons</td><td>'.$PresetDefHaloMoonFig.'</td><td>'.$DefHaloMoonFig2.'</td></tr> </table> '.if($DefHaloMoonFig2=='0'){.' The Attacker has won the battle!'. } else {.' The Defender has won the battle! .}';[/code] It doesnt seem to want the if statements there to work :( Any help? Thanks, ~Dark dude~
  6. [quote author=AndyB link=topic=107538.msg431607#msg431607 date=1157896935] Putting more than one value in a field is easy; it's getting them out separately that's the problem. Are you [b]absolutely certain[/b] that that's what you want to do?  One more field in your database table is pretty cheap. [/quote] Yeah, I just want the two variables to merge :P Because my finding system finds "Colonies" by the number after it. The "UpDateNum" variable holds the number that's to go after the name "Colony". So, if there are already 4 colonies, UpDateNum will equal 5, and it will input into the database "Colony5"...
  7. [quote] $num = mysql_numrows($result); $UpDateNum = $num + 1; $query="INSERT INTO Planets VALUES ('','$Galaxy','$System','$Planet','$Continent','',[color=red][b]'Colony'[/b][/color],'$Username','0','500','10','250','100','Colony11','1','','','','','','','','','$ip',CURRENT_TIMESTAMP(NOW()))"; mysql_query($query);[/quote] Focus on the bit in bold red... I want to be able to make it something like: 'Colony(whatever $UpDateNum is)' But I cant find how to do it. I've tried 'Colony'.$UpDateNum.'' but that doesnt work... Please help? ???
  8. I see nothing wrong with that code, it should do exactly what you explained it should do ;)
  9. [quote author=Mouse link=topic=105508.msg422088#msg422088 date=1156539630] "The image “http://localhost/atm-v5/thermo[b][color=red].php[/color][/b]” cannot be displayed, because it contains errors." Hmmm... needs work (note to self: maybe i should just do this in photoshop...!) Any One? Mouse [/quote] I dont believe images use the .php extension ;) Php = Script extension, an Image extension = .gif, .jpg, .png, .tif, .bmp, .psd etc
  10. How do you hide frames? I've managed to get them to hide in Internet Explorer, but it wont hide in Firefox etc... See: http://img297.imageshack.us/img297/1716/borderiie1.png http://img170.imageshack.us/img170/1165/borderte6.png Here are the pages codes (as you can see, some irrelevant bits are cut out): [code]<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE"> <? include("dbinfo.inc.php"); mysql_connect(localhost,$username,$password); @mysql_select_db($database) or die( "Unable to select database"); $query = "SELECT * FROM Processes WHERE Activator='$Username'"; $result = mysql_query($query) or die(mysql_error()); $results = mysql_fetch_array($result); $num=mysql_numrows($result); ?> <FRAMESET COLS=16%,*> <FRAME SRC="sidebar.php?<? echo session_id() ?>" NAME=SIDEBAR FRAMEBORDER=NO NORESIZE> <FRAMESET ROWS=15%,*,<? $m=0; while ($m < $num){ if($m==$num-1){ echo '0.00%'; } else { echo '0.00%,'; } $m++; } ?>"> <FRAME SRC="topbar.php?<? echo session_id() ?>" NAME=TOPBAR NORESIZE> <FRAME SRC="overview.php?<? echo session_id() ?>" NAME=MAIN FRAMEBORDER=NO BORDERCOLOR='#000033'> <? $i=0; while ($i < $num){ $id=mysql_result($result,$i,"id"); ?> <FRAME SRC='BuildFindzs.php?id=<? echo $id ?>' NAME=BUILDFIN<? echo $id ?> FRAMEBORDER=NO BORDERCOLOR='#000033' NORESIZE> <? $i++; } ?> </FRAMESET>   </FRAMESET> [/code] So yeah, how do you hide them? And I dont want them disabled, they need to work themselves in those isolated frames >_>
  11. [quote author=onlyican link=topic=102862.msg408856#msg408856 date=1154611890] try try $BannedBy != $Username &&... (Without the single quotes round Username) [/quote] That solved it =] Thanks a lot =D
  12. Ok, I have set an If statement on my website so users with the status "Game Moderator" can't unban users banned by another Staff member. This is the script: [code=php:0]$query="SELECT * FROM Users WHERE Username='$Unbantarget'"; $result=mysql_query($query); $Status2=mysql_result($result,$i,"Status"); $BannedBy=mysql_result($result,$i,"BannedBy"); $query="SELECT * FROM Banned WHERE Username='$Unbantarget'"; $result=mysql_query($query); $num=mysql_numrows($result); if($BannedBy!='$Username' && $Status=='Game Moderator'){ echo "<span style=color:red>".$Username.", You cannot unban a user you did not ban!<br> Contact the Game Moderator (".$BannedBy.") of the User."; } else { if($Status2=='Banned'){ $query="UPDATE Users SET Status='User', BannedBy='', BannedOn='', BannedUntil='', BannedFor='' WHERE Username='$Unbanvictim'"; mysql_query($query); $query="UPDATE Banned SET BannedFor='$Condition' WHERE Username='$Unbanvictim' && BanTime='$num'"; mysql_query($query); echo "User ".$Unbantarget." has been successfully unbanned!"; } else { echo "Typo error? Stupidity? Either way, the user isnt banned"; } }[/code] However, when I debugged this by trying to unban a user I had banned, it came up with the message "Test, You cannot unban a user you did not ban! Contact the Game Moderator (Test) of the User." What's going on? o.O
  13. Ok, sounds like it will work, just two questions: - If the user shutdown his computer, will the countdown until execution still occur on the server? - How would you get it to work so even if you logged onto another computer, then the countdown would still be going?
  14. I'm currently working on a Php/MySQL based game that requires a server-side background delay to immitate waiting for it to march out, attack and then return... In script terms, I want a user to be able to submit a form at any time and it then delays the processing script until a specific amount of seconds/minutes/hours/days has passed. During this delay period, the user should be able to navigate the site, logout, go on holiday, whatever, without breaking the script. So, I thought about making it so when you submit the form, it sends the details to a server background script or summat, and then, even if you're not viewing the script, once the time passes, the script activates. Sounds well and good... but... How do I do it??? Some said Cron job, but I highly doubt i'd be able to Cron job a script saying "If ($timecompletion > time()) then..." to run every second of the day... So, would Javascript be any help? It seems the most probable to help...
  15. Yeah, this might be because of the headers the .co.nr domain provider is using. Similar thing goes with sessions, those redirect urls use headers that stop sessions from working in everything but firefox...
  16. Ohhh, thanks a lot guys, that's solved my problem now ;D :) ;) ~Dark dude~
  17. Lol, I encountered this problem earlier, I got passed it by adding: [code]$query="UPDATE Users SET LastActive=CURRENT_TIMESTAMP(NOW()) WHERE Username='$_SESSION['Username']'"; mysql_query($query);[/code] to every page, and then: [code]<? $query="SELECT * FROM Users WHERE UNIX_TIMESTAMP(LastActive) > UNIX_TIMESTAMP(NOW()) - 300"; $result3=mysql_query($query); $num3=mysql_numrows($result3); $i=0; $rnm2=1; while ($i <= $num3){ $Username3=mysql_result($result3,$i,"Username"); if($rnm2 < $num3){ echo ''.$Username3.', '; } elseif($rnm2==$num3){ echo ''.$Username3.'.'; } $rnm2++; $i++; } ?>[/code] to the place you wanna view who's online. This shows everyone who's been active in the last 5 minutes, which is close enough...
  18. [code]$mintime = 15; now = time(); $timediff = ($now - $_SESSION["StartTime"] + 1); $newdate = $newdate.' - '.$timediff.' - '.$now.' - '.$_SESSION["StartTime"];[/code] ^^^ You're not signing now as a variable at the top: [code]$mintime = 15; $now = time(); $timediff = ($now - $_SESSION["StartTime"] + 1); $newdate = $newdate.' - '.$timediff.' - '.$now.' - '.$_SESSION["StartTime"];[/code] Is how it should be :P
  19. Yeap, it's set to Int(20) and it's now set to Null However, it's still outputting the result 2018039464 into the field...
  20. It's still only returning the year  ??? In the "BannedUntil" field on the entered row, it now says: 2033... Edit: Actually, I tried again and it's put 2018015467 into there... o.O
  21. I'm using htaccess to [i]try[/i] and block specific people from using my site... Big failure/10 [code] order deny,allow deny from 81.177.15 deny from 81.177.14 deny from 85.255.113 deny from 85.255.114 deny from 195.225.176.86 deny from 85.255.117.250 allow from all[/code] I'm trying to do something like that (I used made up IPs for this display so nobody is threatened). So, I blocked my friends IP as a test, and he could still use my site as normal... My friend does not use a dynamic IP... So, how [b]do[/b] you block IPs from your site using htaccess, what am I doing wrong, and how what does someone entering from a "denied ip" see? Thanks, ~Dark dude~
×
×
  • 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.