Results 1 to 5 of 5

Thread: Could use assistance with a script please

  1. #1
    Join Date
    Jun 2015
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Could use assistance with a script please

    1) Script Title: Local Time Script

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex6/localtime.htm

    Greetings,

    I am attempting to build a webpage that lists the members of a gaming guild and their current time to better help members get in touch with those with similar schedules. I am doing this by creating a table with each members name, followed by their time zone, and finally their local live time. I am new to javascript so I was looking around the web for scripts that I could incorporate into my webpage to accomplish this. "Local Time script" seemed to fit what I needed perfectly however I cannot get it to function.

    I created a generic test page on my virtual test server. I copied and pasted step 1 into the head section. I then pasted
    Code:
    <span id="timecontainer"></span>
    into my table which is in the body section and at the end of my body section I put
    Code:
    <script type="text/javascript">
    new showLocalTime("timecontainer", "server-php", 0, "short")
    </script>
    however it only gives me readout of NaN:NaN:NaN AM (undefined).

    Am I missing some configuration or is it something else?

    Here are environment details:
    Windows Server 2008 R2 in Virtualbox
    IIS 7
    Php v5.3.28
    Viewing with Firefox 38.0.5

    Any pointers would be appreciated, thanks!

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    For PHP pages, the script uses the following PHP code to retrieve the server's date as a string:

    Code:
    <? print date("F d, Y H:i:s", time())?>
    If you add just the above code to your PHP page, does it output a date string?
    DD Admin

  3. #3
    Join Date
    Jun 2015
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by ddadmin View Post
    For PHP pages, the script uses the following PHP code to retrieve the server's date as a string:

    Code:
    <? print date("F d, Y H:i:s", time())?>
    If you add just the above code to your PHP page, does it output a date string?

    Thank you for the reply ddadmin.


    It does not display anything.

    EDIT:
    I went ahead and moved the page over so that it could be displayed publicly. http://shadyvalesyndicate.com/timer.php

    The stand alone
    Code:
    <? print date("F d, Y H:i:s", time())?>
    I have placed between the welcome and the table.
    Last edited by Baralis; 06-15-2015 at 08:41 PM.

  4. #4
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Hmm it seems your server isn't recognizing the code in between <? ?> as PHP code. What if you changed it to:

    Code:
    <?php print date("F d, Y H:i:s", time())?>
    Do you know for sure that PHP code gets executed on your server on pages with .php extension?
    DD Admin

  5. The Following User Says Thank You to ddadmin For This Useful Post:

    Baralis (06-15-2015)

  6. #5
    Join Date
    Jun 2015
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by ddadmin View Post
    Hmm it seems your server isn't recognizing the code in between <? ?> as PHP code. What if you changed it to:

    Code:
    <?php print date("F d, Y H:i:s", time())?>
    Do you know for sure that PHP code gets executed on your server on pages with .php extension?
    That fixed it!

    I really appreciate your help, thank you so much.

Similar Threads

  1. Replies: 5
    Last Post: 11-19-2011, 02:38 PM
  2. Script Assistance
    By vwants in forum Dynamic Drive scripts help
    Replies: 1
    Last Post: 10-29-2011, 10:51 AM
  3. Need some assistance with ajax tabs 2.2 DD script
    By daninma in forum JavaScript
    Replies: 0
    Last Post: 05-26-2010, 06:42 PM
  4. Tab Content script (v 2.0) - Anchor Assistance
    By dalmuti in forum Dynamic Drive scripts help
    Replies: 1
    Last Post: 08-01-2008, 07:13 PM
  5. Switch Menu Script CSS Assistance
    By Showtime2k6 in forum Dynamic Drive scripts help
    Replies: 1
    Last Post: 10-17-2005, 07:06 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •