techmeister-board.com
New Member
So I have a page where the user can only visit once every 24 hours if they're in the database.Right now T have timestamp and time() logged in the database, however I can't seem to figure out how to make a countdown timer.Here's my attempt\[code\]if (mysql_num_rows($result) > 0) { $result = mysql_fetch_assoc($result); $votetime = $result["timestamp"]; } if ($votetime != -1) { echo "You can vote in... <span id=\"cntdwn\">loading...</span><br />"; echo "You can vote in... <div id=\"cntdwn\">test1...</div><br />"; ?> <script type="text/javascript"> $(document).ready(function() { var dthen = new Date(<?php echo ($votetime+86400);?>000); var dnow = new Date(); gsecs = Math.floor(new Date(dthen-dnow)/1000); CountBack(gsecs); }); </script> <?php echo "You can vote in... <span id=\"cntdwn\">loading...</span><br />"; echo "You can vote in... <div id=\"cntdwn\">test1...</div><br />"; } echo "test: ".date($votetime);\[/code\]The span/div tags both do not work (tried one at a time, added both for purpose of this).Any ideas?