Jump to content

ILYAS415

Members
  • Posts

    292
  • Joined

  • Last visited

Everything posted by ILYAS415

  1. Thanks alot! It worked. This problems been buggin me for a few days
  2. Okay i got a javascript time which changes to match the time every __ seconds/minutes/hours. However this time depended on the persons computer time. I wanted the script to correspond to the server time so i made these changes... Before: <script> <!-- function show2(){ if (!document.all&&!document.getElementById) return thelement=document.getElementById? document.getElementById("tick2"): document.all.tick2 var Digital=new Date() var hours=Digital.getHours() var minutes=Digital.getMinutes() var seconds=Digital.getSeconds() var dn="PM" if (hours<12) dn="AM" if (hours>12) hours=hours-12 if (hours==0) hours=12 if (minutes<=9) minutes="0"+minutes if (seconds<=9) seconds="0"+seconds var ctime=hours+":"+minutes+":"+seconds+" "+dn thelement.innerHTML="Time: "+ctime+"" setTimeout("show2()",1000) } window.onload=show2 //--> </script> Server time: <script> <!-- function show2(){ if (!document.all&&!document.getElementById) return thelement=document.getElementById? document.getElementById("tick2"): document.all.tick2 var Digital=new Date() var hours=Digital.setHours(<?php echo gmdate("h"); ?>); var minutes=Digital.setMinutes(<?php echo gmdate("i"); ?>); var seconds=Digital.setSeconds(<?php echo gmdate("s"); ?>); var hour=Digital.getHours(); var minute=Digital.getMinutes(); var second=Digital.getSeconds(); var dn="PM" if (hours<12) dn="AM" if (hours>12) hours=hours-12 if (hours==0) hours=12 if (minutes<=9) minutes="0"+minutes if (seconds<=9) seconds="0"+seconds var ctime=hour+":"+minute+":"+second+" "+dn thelement.innerHTML="Time: "+ctime+"" setTimeout("show2()",1000) } window.onload=show2 //--> </script> I have 2 problems, the first one is that:- The server time doesnt change as the user stays on the same page second problem: Lets say the server time is 5am exact. This is how it appears on the site - 5:0:0 I want it to appear as 05:00:00 Please help its urgent. p.s. if u may hav noticed i used php
  3. Thanks! it worked! if its not too much trouble for you could you also add in seconds cause i hav no idea how to add that in. Or can you send me a link to the reference you got that from (if u did that is)
  4. Hiya, i need help with a php countdown script that is supposed to echo a time to the next reset (which is every 4 hours starting from 12:00 AM). Heres what i got at the moment and im trying to get it right because at the moment its saying i got 9hours left to the next reset. This is wrong because the next reset is always every 4 hours. Heres my code... <?php $gettime= gmdate('h'); if ($gettime > "00" && $gettime < "04"){ $times="4"; }elseif ($gettime > "04" && $gettime < "08"){ $times="8"; }elseif ($gettime > "08" && $gettime < "12"){ $times="12"; }elseif ($gettime > "12" && $gettime < "16"){ $times="16"; }elseif ($gettime > "16" && $gettime < "20"){ $times="20"; }elseif ($gettime > "20" && $gettime < "23"){ $times="0"; } countdown($time, 0); function countdown($time, $minute) { $day= gmdate('d'); echo "$day<br>"; // make a unix timestamp for the given date $the_countdown_date = mktime($day, $hour, $minute, 0); // get current unix timestamp $today = gmdate('h i s'); $difference = $the_countdown_date - $today; if ($difference < 0) $difference = 0; $days_left = floor($difference/60/60/24); $hours_left = floor(($difference - $days_left*60*60*24)/60/60); $minutes_left = floor(($difference - $days_left*60*60*24 - $hours_left*60*60)/60); // OUTPUT echo "Next reset in: ".$hours_left."h ".$minutes_left."m"; } ?> I would appreciate it if you can help me with this code. I need it for a txt-based game im making. Thanks
  5. I am currently developing a game for someone but ive hit a dead end as im having strange trouble with one the the scripts. In this script I used the while command to echo multiple weapons inside a <select> tag. When i run the script everything works, apart from the mysql query which doesnt work how its supposed to... The bit at the end doesnt work. I didnt include the $username variable in the script but it is on the page though. The problem with the query is that when it runs the query, its sets the weapon to Nothing instead of the selected weapon name.
  6. www.Yurx.com/index.php?referrerid=1581 Yes free. It is ad free and once you've signed up on thier forums all you need to do is request plan 1 (25mb) to get your site hosted. It has a free cpanel! Once youve raised certain amount of points on the forum you can upgrades such as free domain name and you can also upgrade to different plans eg. plan 2 (50mb)
  7. www.Yurx.com/index.php?referrerid=1581 try it out. Its really really good! A free cpanel host withno ADS!
  8. Hiya, theres something wrong with my site. I uploaded all the scripts for my site and configured the db_connect but when i visit the index page or register and index2 it alls says:- arning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in /home/ilyas/public_html/includes/functions_index.php on line 15 Look at the site:- www.thugs-incorporated.serverheavens.net
  9. reply... plza i need help on this
  10. Hiya, im making a online multiplayer mafia game and need help setting it up. Ive set up most of it and have already set up the database connection but i think there are problems with the script and all. If anyone can help me i will make them administrator (if they want to). [url=http://www.thugs-incorporated.serverheaven.net]www.thugs-incorporated.serverheaven.net[/url] The reason i dont understand php and cant fix this is becuause im an amateur to php :) lol  ;D
×
×
  • 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.