开发者

PHP countdown timer problem using javascript

I'm using php 5.3.6 and mysql 5.1.54 with apache webserver windows edition on my local pc.

And my web host have php 4.0.2 and mysql 4.1.2 with apache webserver linux edition. I'm using a script and it has a countdown timer using php/javascript. It does not have any problem in my pc.

But when i upload to my web host and run the code , it shows me 'Nan Nan' (Not a Number) in countdown field. Interesting point is: when i change setTimout(...,1000) to setTimeout(...,2000), everything will be ok!

But in this case, it countdowns every 2 seconds!, that's not my favorite. I'm not sure if it is a bug in php version at my web service or it is someth开发者_运维问答ing else.


Huh, the code in the question is javascript, i.e. client-side. Why should anything change when this code is on a different host?

Within the javascript you have this php echo statement

<?=$item_details['auction_id'];?>

On the client-side this should not work so I have to assume you are creating this javascript on the fly server-side and embed it in html somewhere. Hence, the real question is: What array is $item_details and where is the data coming from? Take a look at that piece in your php script and if you cannot find the answer yourself edit/update your question with that code.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜