Jump to content


Photo

a real problem with counting down!!!! need help big time!!!!


  • Please log in to reply
5 replies to this topic

#1 aleman84

aleman84
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 21 June 2006 - 10:05 PM

Right from the start, I need a script that counts up to 45 minutes and every 1 minute it goes a function. what function is not the issue just a general function. It also needs to display the minutes and seconds for the user to see. This needs to auto update and the time needs to be based on server time not client side.

I know its alot to ask but does any one know how to do this as its so very important!!!!

Need help from the best php guys on the net!!!!


lol I am so in need of help lol.

Cheers.

#2 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 21 June 2006 - 10:12 PM

You cannot have a php script countdown. You will need to use a combination of javascript and php and some ajax implimentation.

Ever looked at Ajax? [a href=\"http://marc.theaimsgroup.com/?l=php-general&m=112198633625636&w=2\" target=\"_blank\"]here[/a] is a quick introduction.

#3 aleman84

aleman84
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 21 June 2006 - 10:17 PM

oh, oh, oh! now I thought this might be simple ah! ok, well im new to AJAX! this is a whole new area for me. What I am looking to do is that possible after learning a little AJAX? or will I have to get into it big time?


Thank you for the fast response!

#4 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 21 June 2006 - 10:24 PM

Sounds pretty simple to me. You'd just need to setup a javascript timer that requests your php function every minute for 45 minutes while displaying the time to your client.

Ajax is a set of theories more than a technoligy, dont let it get to you.

#5 aleman84

aleman84
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 21 June 2006 - 10:32 PM

Truely a master of PHP and all things scripting. Thank you for your help!


Now all I need is for you to write the script for me! Just joking unless you want to lol!

cheers for the guidance.

#6 avo

avo
  • Members
  • PipPipPip
  • Advanced Member
  • 148 posts
  • Locationstaffordshire uk

Posted 21 June 2006 - 11:00 PM

HI

This may help you out a little but it will count down
removing the echo "<br />" it will count accross

sleep is set at 1 second make this 60 per minute

for( $i=0;$i<45;$i++){
    echo $i;
    echo "<br />";
    ob_flush ();
    flush();
    sleep(1);
    
}

it will not refresh to count up in one letter characters

cheers
Im loving it ........




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users