SitePoint Sponsor

User Tag List

Results 1 to 13 of 13
  1. #1
    SitePoint Member
    Join Date
    Aug 1999
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I am using the following script to update the last modify date. Its displaying the currrent date on IE, but on Netscape its displaying Last Updated: 1969-12-31. Can someone provide me a solution.

    Thanks
    Sen

    <script language="JavaScript1.3">
    var mydate=new Date(document.lastModified)
    var year=mydate.getYear()
    if (year < 1000)
    year+=1900
    var day=mydate.getDay()
    var month=mydate.getMonth()+1
    if (month<10)
    month="0"+month
    var daym=mydate.getDate()
    if (daym<10)
    daym="0"+daym
    document.write("<small><font color='000000' face='Arial'><a href='/cdo/index_e.html#date'><b>Last Updated: "+year+"-"+month+"-"+daym+"</b></a></font></small>")
    </script>



  2. #2
    <? echo "Kick me"; ?> petesmc's Avatar
    Join Date
    Nov 2000
    Location
    Hong Kong
    Posts
    1,508
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't know about Javascript but you could use SSI,

    then it would be:

    <!--#config timefmt="%Y-%m-%" -->
    <!--#echo var="LAST_MODIFIED" -->



  3. #3
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Pete what language is that Perl? Please don't say SSI.
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  4. #4
    <? echo "Kick me"; ?> petesmc's Avatar
    Join Date
    Nov 2000
    Location
    Hong Kong
    Posts
    1,508
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's not SSI...

    Actually it is...

    Why? Is there a problem. I think there is a function in javascript that echos the last_modified date...

    But who knows.....

    HOW ABOUT:

    <Script language="Javascript">
    update = new Date(document.lastModified)
    theMonth = update.getMonth() + 1
    theDate = update.getDate()
    theYear = update.getYear()
    document.writeln("<i>Last Updated:" + theMonth + "-" + theDate + "-" + theYear + "</i>")
    </script>
    <Edited by petesmc on 01-16-2001 at 12:03 PM>

  5. #5
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No problem just wondering SSI stands for "Server Side Include" So what language are those commands for? What language interprets it on the sevrer?
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  6. #6
    <? echo "Kick me"; ?> petesmc's Avatar
    Join Date
    Nov 2000
    Location
    Hong Kong
    Posts
    1,508
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    SSI...

    you make the endings of you HTML pages use .shtml or make a .htaccess file making the server parse .html documents.

    Did you try the Javascript i gave you??

    i think it could work but not sure...

  7. #7
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I understand how it all works and how to set it up but you are misunderstanding my question. What interpreter does the sevrer use to parse the command s you write in the SSI tag?
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  8. #8
    <? echo "Kick me"; ?> petesmc's Avatar
    Join Date
    Nov 2000
    Location
    Hong Kong
    Posts
    1,508
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hmmm....

    I would guess a SSI interpreter....

  9. #9
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Anyone else......
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  10. #10
    SitePoint Wizard TWTCommish's Avatar
    Join Date
    Aug 1999
    Location
    Pittsburgh, PA, USA
    Posts
    3,910
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by petesmc
    Why? Is there a problem. I think there is a function in javascript that echos the last_modified date...
    Well, we all know document.lastmodified yields the last modified date, so JavaScript can handle it just fine.

    Seems the problem here is more with Netscape compatibility issues, unless I'm totally misunderstanding the original post.

    Perhaps "sen" can reply and shed some light on things?

  11. #11
    SitePoint Wizard westmich's Avatar
    Join Date
    Mar 2000
    Location
    Muskegon, MI
    Posts
    2,328
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You use the native server environment to process SSI regardless of NT, W2K, Linux, or Unix. Pete is right with the SSI interpreter, however, I don't know how standardized the commands are.
    Westmich
    Smart Web Solutions for Smart Clients
    http://www.mindscapecreative.com

  12. #12
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks westmich, I always thought SSI was just to include external pages into a file using a .shtml .shtm file or into whatever files the sevrer is set to parse SSI on. I was just wondering where Pete got those functions from where can someone find a listing of the commands available via SSI calls?
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  13. #13
    AdSpeed.com Son Nguyen's Avatar
    Join Date
    Aug 2000
    Location
    Silicon Valley
    Posts
    2,241
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Freddy, there are SSI and also Extended SSI (SSI with if/else - conditional statements)

    These 2 links are very good in knowing what SSI can do:
    http://bignosebird.com/ssi.shtml
    http://www.useforesite.com/tut_ssi.shtml

    What Pete gave the format of the output (date), then the second directive is actually output the date with predefined format.
    - Son Nguyen
    AdSpeed.com - Ad Serving and Ad Management Made Easy


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
  •