HTML, PHP, Iframe, date...?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • Carl II
    Sergeant

    • Jun 2006
    • 23

    HTML, PHP, Iframe, date...?

    I need some help. Hope to find it here.
    I'd like to put the date on my website. Browsing this forum I found two ways to do so. The first I donnt understand (using php and an Iframe) and one that works, but doesnt look the way I'd like it to. You can see the result at www.snelensimpeleengratiswebsitebouwen.com wich is very much under construction (published it a few hours ago).
    As you can see the date is in a button. What I like it to be is just plain text in the right font.

    I found the script I used on this forum and narrowed it down to:

    <form name=myForm>
    <input type=button value="Loading..." name=clock></form>
    <SCRIPT LANGUAGE="JavaScript"><!--
    function runClock(){
    theTime = window.setTimeout("runClock()", 1000);
    d = new Date();
    day = d.getDay();
    mon = d.getMonth();
    date = d.getDate();
    year = d.getYear();
    zday=new Array();
    zday=["Zondag","Maandag","Dinsdag","Woensdag","Donderdag " ,"Vrijdag","Zaterdag"];
    zmon=new Array();
    zmon=["Januari","Februari","Maart","April","Mei","Ju ni", "Juli","Augustus","September","Oktober","November" ," December"];

    document.myForm.clock.value=""+zday[day]+", "+zmon[mon]+" "+date+", "+year+"";}
    runClock();
    //--></script>

    Can somebody tell me how to change it into what I'm looking for. Have trying and browsing both the net and this forum for a day and a half. Its time to swollow my pride and ask for help :)

    Carl
  • Watdaflip
    Major General

    • Sep 2005
    • 2116

    #2
    Re: HTML, PHP, Iframe, date...?

    I only understand basic javascript, so Im not sure I can help you there too much. I don't know who said you have to use an iframe to use a php clock, all you have to do is enter this line of php code whever you want it to appear on your webpage, and make sure it is published as a .php NOT .html

    <? echo date('F j Y'); ?>

    Here is a table of all the timeformating, what I gave you above, F j Y, will format the date like this...
    June 14 2006, if you make it... F j, Y.... it will be June 14, 2006

    Hope that helps

    Register/Login Script
    Do you use a Password Protected Directory? Need a way to allow users to make their own account, try my .htaccess Login Script

    Comment

    • Carl II
      Sergeant

      • Jun 2006
      • 23

      #3
      Re: HTML, PHP, Iframe, date...?

      Thanks Watdaflip, but this is where I go wrong, i'm afraid. I donnt understand how to enter the php code in my website and neither do I understand how to publish it (the page? the code?) as .php instead of .html.

      I'd realy apreciate it if you can make this dummy understand...

      Carl

      Comment

      • Watdaflip
        Major General

        • Sep 2005
        • 2116

        #4
        Re: HTML, PHP, Iframe, date...?

        im not 100% sure how to do it in bluevoda (I don't use it), but I do know that bluevoda has a feature where you can enter in html. Use that to enter the php code:
        <? echo date('F j Y'); ?>
        And drag it where ever you want it to be. When I took a look at the program a couple months back I know if gave you the option to publish the webpage as a .html, or a .php. Perhaps right click and select properties...

        Sorry i cant help with the specifics, maybe someone who uses BV can give you the specifics.

        If you want, on the page where you want the clock to appear place like a 100px wide 20 px high box and publish. Give me the link and ill add the clock where the box is for you and give you a download link for the file.

        Register/Login Script
        Do you use a Password Protected Directory? Need a way to allow users to make their own account, try my .htaccess Login Script

        Comment

        • Langlois
          First Sergeant

          • Jan 2006
          • 74

          #5
          Re: HTML, PHP, Iframe, date...?

          I am using the script below. Simply place it in a HTML box and move the HTML box to the desired location. If you need the date displayed in another language, simply change the months and days in between the "s

          Hope this helps.

          <script language="JavaScript" type="text/javascript">
          <!--
          var
          month = new Array();
          month[0]="January";
          month[1]="February";
          month[2]="March";
          month[3]="April";
          month[4]="May";
          month[5]="June";
          month[6]="July";
          month[7]="August";
          month[8]="September";
          month[9]="October";
          month[10]="November";
          month[11]="December";
          var
          day = new Array();
          day[0]="Sunday";
          day[1]="Monday";
          day[2]="Tuesday";
          day[3]="Wednesday";
          day[4]="Thursday";
          day[5]="Friday";
          day[6]="Saturday";
          today = new Date();
          date = today.getDate();
          day = (day[today.getDay()]);
          month = (month[today.getMonth()]);
          year = (today.getFullYear());
          suffix = (date==1 || date==21 || date==31) ? "st" : "th" &&
          (date==2 || date==22) ? "nd" : "th" && (date==3 || date==23) ? "rd" : "th"
          function print_date()
          {
          document.write(day + "," + "&nbsp;" + date + "<sup>" + suffix + "</sup>" + "&nbsp;" +
          month + "," + "&nbsp;" + year);
          }
          // -->
          </script>
          <script>
          <!--
          print_date();
          //-->
          </script>

          Comment

          • davidundalicia
            General

            • Mar 2006
            • 6294

            #6
            Re: HTML, PHP, Iframe, date...?

            Langlois:

            Your code works perfectly and was easy to install

            I suggest that you put in the bv tips and tricks forum.........
            Have fun
            Regards..... David

            Step by Step Visual Tutorials for the complete beginner
            Newbies / Beginners Forum
            FREE Membership Login Scripts: - Meta Tags Analyzer
            My Social Networking Site - Free Contact Forms
            Finished your New website!! Now get it noticed Here:

            Comment

            • Langlois
              First Sergeant

              • Jan 2006
              • 74

              #7
              Re: HTML, PHP, Iframe, date...?

              will do

              Comment

              • Carl II
                Sergeant

                • Jun 2006
                • 23

                #8
                Re: HTML, PHP, Iframe, date...?

                Watdaflip, Langlois,

                Thanks guys! Great help, great script!

                Carl

                Comment

                • Carl II
                  Sergeant

                  • Jun 2006
                  • 23

                  #9
                  Re: HTML, PHP, Iframe, date...?

                  Ooopppssss.... the finishing touch: how do I get it published in the right font & size?

                  Thanks again!
                  Carl

                  Comment

                  • Carl II
                    Sergeant

                    • Jun 2006
                    • 23

                    #10
                    Re: HTML, PHP, Iframe, date...?

                    Guess what!? I did it! Took me ages, but with the help of some posts in this forum, some swearing and some praying it works just the way I want it!

                    Thanks again!

                    Comment

                    • davidundalicia
                      General

                      • Mar 2006
                      • 6294

                      #11
                      Re: HTML, PHP, Iframe, date...?

                      Thats half the fun......

                      be lucky..................
                      Have fun
                      Regards..... David

                      Step by Step Visual Tutorials for the complete beginner
                      Newbies / Beginners Forum
                      FREE Membership Login Scripts: - Meta Tags Analyzer
                      My Social Networking Site - Free Contact Forms
                      Finished your New website!! Now get it noticed Here:

                      Comment

                      Working...
                      X