Jump to content

tesseract

Members
  • Posts

    3
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling
  • Location
    Queens, NY

tesseract's Achievements

Newbie

Newbie (2/6)

4

Reputation

  1. Thanks kongondo, and to all those who monitor this forum and take the time to reply w/solutions.
  2. Before reading your replies, I wanted to send the user's local time back to php, then run a bunch of astronomical calculations on the server, then refresh the visitor's page. But that's 2 reloads after the 1st one, and it looks suspicious when a page blinks twice. Ajax might work without refreshing, but it's beyond me. So I've thought of a work-around by doing the .php calculations using UT time, then make adjustments in .js based on visitor's UToffset. ProcessWire is awesome. Thanks guys, Gregory www.1au.com
  3. My 1st post. I'd like to place the user's local time (obtained via javascript) into a ProcessWire php variable. I've tried using $session: <!DOCTYPE html> <html> <head> <script type="text/javascript" src="<?php echo $config->urls->templates?>scripts/jquery-1.4.2.min.js"></script> <script type="text/javascript"> document.ready = function() { var visitortime = new Date(); "<?php echo $session->time; ?>" + "=" + visitortime; }; </script> </head> <body> <?php $t = $session->time; echo $t; ?> </body> </html> and $input with a hidden form submitted by javascript: <!DOCTYPE html> <html> <head> <script type="text/javascript" src="<?php echo $config->urls->templates?>scripts/jquery-1.4.2.min.js"></script> <script type="text/javascript"> document.ready = function () { var visitortime = new Date(); document.getElementById("utoffset").setAttribute("value",visitortime); document.getElementById("utoffset").submit(); } </script> </head> <body> <form action="." method="post"> <input type="hidden" id="utoffset" name="vt"> </form> <?php echo $input->post->utoffset; ?> </body> </html> Both display blank pages (using the above .php files as templates). Does anyone see what I'm missing? Or is there an easier way? Completely baffled.
×
×
  • Create New...