|
hi, 我这里有问题想代我的朋友请教你们。
我的朋友做了一个拍卖的网站,所以他做了一个倒数时间的程式以计算拍卖物品在网页的逗留时间,如时间一到,物品将会自动停止拍卖。
以下 coding 的主要任务是从 database retrieve 开始拍卖时间的资料,然后进入倒时任务
<?
session_start();
include "include/db.php";
$requestid=$_REQUEST['request'];
$result2 = mysql_query("SELECT * FROM auction WHERE auctionid = '$requestid'" ) or die (mysql_error());
$row = mysql_fetch_array($result2);
$start_date=$row['exp'];
echo $start_date;
?>
但是以上 coding 执行不到倒时的任务,因为当它从 database retrieve 资料的时候出现问题,它的网页显示不到倒数计时的画面,不知是否 coding 的 sysntax 不对呢?当如果直接 key in 开始时间的资料 "echo $start_date 代替 setcountdown(2008,12,07,18,30,00)" 在以上 coding 的话,它的网页将会显示倒数计时的画面
以下是原本的 coding:
function setcountdown(theyear,themonth,theday,thehour,themin,thesec){
yr=theyear;mo=themonth;da=theday;hr=thehour;min=themin;sec=thesec
}
//////////CONFIGURE THE COUNTDOWN SCRIPT HERE//////////////////
//STEP 1: Configure the countdown-to date, in the format year, month, day, hour(0=midnight,23=11pm), minutes, seconds:
setcountdown(2008,12,07,18,30,00)
希望在这可以得到解决的答案,谢谢
[ 本帖最后由 keithgoh317 于 19-3-2006 10:35 PM 编辑 ] |
|
|
|
|
|
|
|

楼主 |
发表于 22-3-2006 12:10 PM
|
显示全部楼层
没有人可帮到吗?我的朋友的 Project 快交了。 |
|
|
|
|
|
|
|
发表于 22-3-2006 04:17 PM
|
显示全部楼层
你只是echo了$start_date而已,并没有把$start_date的数据pass到setcountdown里面。
把echo那一部分试试看用这个。
- $s = strtotime($start_date);
- if(!$start_date) return;
- $year = date("Y",$s);
- $month = date("m",$s);
- $day = date("d",$s);
- $hour = date("H",$s);
- $min = date("i",$s);
- $sec = date("s",$s);
- echo "setcountdown($year,$month,$day,$hour,$min,$sec);";
复制代码 |
|
|
|
|
|
|
|

楼主 |
发表于 23-3-2006 04:41 AM
|
显示全部楼层
|
|
|
|
|
|
| |
本周最热论坛帖子
|