/    Sign up×
Community /Pin to ProfileBookmark

PHP Ajax Count Down Timer

hi guys im trying to build a auction system where by it will have a count down time and when users bid on the item it will extend for about 15 secs for each bid here are the example of the website that i wana make listed below

[url]www.crazybid.sg[/url]

the pink color count down timer

what i have found is [url]http://keith-wood.name/countdown.html[/url]

but how do i make it in ajax way of like httprequest to merge with countdown timer ?

like when users bids it will add the time to the existing countdown timer and after that the page will not refresh but it will refresh it in the back end?

Please Advise


_______________

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@baddotauthorFeb 17.2010 — i want the time to adjust immediately when the user submits the bid, then just add 15 seconds to the timer after you successfully send the bid via ajax. can anybody help me ?
Copy linkTweet thisAlerts:
@baddotauthorFeb 17.2010 — Heres my code i am stucked with the retriving from database and adding a 10 sec time to the current product when a bid is placed

[code=php]<?
define('INCLUDE_CHECK',true);
require('connect.php');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta http-equiv="content-language" content="en" />
<meta name="robots" content="all,follow" />

<meta name="author" lang="en" content="All: Your name [www.url.com]; e-mail: [email protected]" />
<meta name="copyright" lang="en" content="Webdesign: Nuvio [www.nuvio.cz]; e-mail: [email protected]" />

<meta name="description" content="..." />
<meta name="keywords" content="..." />

<link rel="stylesheet" media="screen,projection" type="text/css" href="css/reset.css" />
<link rel="stylesheet" media="screen,projection" type="text/css" href="css/main.css" />
<!--[if lte IE 6]><link rel="stylesheet" type="text/css" href="css/main-msie.css" /><![endif]-->
<link rel="stylesheet" media="screen,projection" type="text/css" href="css/style.css" />
<link rel="stylesheet" media="print" type="text/css" href="css/print.css" />
<style type="text/css">
@import "css/jquery.countdown.css";

#defaultCountdown { width: 180px; height: 45px; }
#defaultCountdown2 { width: 180px; height: 45px; }
#defaultCountdown3 { width: 180px; height: 45px; }
#defaultCountdown4 { width: 180px; height: 45px; }
</style>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/jquery.countdown.js"></script>
<script type="text/javascript">
$(function () {
var austDay = new Date();
var austDay2 = new Date();
var austDay3 = new Date();
var austDay4 = new Date();
var austDay5 = new Date();
var austDay6 = new Date();
var austDay7 = new Date();
austDay = new Date(austDay.getFullYear() + 1, 1 - 0, 26);
austDay2 = new Date(austDay2.getFullYear() + 1, 1 - 0, 20);
austDay3 = new Date(austDay3.getFullYear() + 1, 1 - 0, 18);
austDay4 = new Date(austDay4.getFullYear() + 1, 1 - 0, 17);
austDay5 = new Date(austDay5.getFullYear() + 1, 1 - 0, 15);
austDay6 = new Date(austDay6.getFullYear() + 1, 1 - 0, 13);
austDay7 = new Date(austDay7.getFullYear() + 1, 1 - 0, 10);
$('#defaultCountdown').countdown({until: austDay});
$('#year').text(austDay.getFullYear());
$('#year').text(austDay2.getFullYear());
$('#year').text(austDay3.getFullYear());
$('#year').text(austDay4.getFullYear());
$('#year').text(austDay5.getFullYear());
$('#year').text(austDay6.getFullYear());
$('#year').text(austDay7.getFullYear());

$('#defaultCountdown2').countdown({until: austDay2});
$('#defaultCountdown3').countdown({until: austDay3});
$('#defaultCountdown4').countdown({until: austDay4});
$('#defaultCountdown5').countdown({until: austDay5});
$('#defaultCountdown6').countdown({until: austDay6});
$('#defaultCountdown7').countdown({until: austDay7});
});
</script>
[/code]
×

Success!

Help @baddot spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...