1. Howdy! Welcome to our community of more than 125.000 members devoted to web hosting. This is a great place to get special offers from web hosts and post your own requests or ads. To start posting sign up here. Cheers! /Peo, FreeWebSpace.net
    Dismiss Notice
  2. Add your web host to our brand new web hosting directory (beta).
    Dismiss Notice

php/html copyright year code

Discussion in 'Programming Help' started by GeorgeB, Jan 19, 2012.

  1. GeorgeB

    GeorgeB
    Expand Collapse
    Chairman/CEO TMCG
    NLC

    Joined:
    Jan 26, 2005
    Messages:
    2,660
    Likes Received:
    15
    I have looked all over on w3schools.com, and cannot find what I am looking for.

    I am using a new wisywig editor, that is better than the last.

    I went to input the html code for the copyright year, and it won't display it correctly.

    The software is basekit. They use CSS and HTML.

    Does anyone know what code can be used?

    Hostgator.com mentioned that the html code I was using was not dynamic, and needed to be static, but my cell got disconnected and I have been on the phone all day, so didnt try calling back.
     
  2. wswd

    wswd
    Expand Collapse
    Premium
    Premium Member NLC

    Joined:
    Dec 9, 2010
    Messages:
    1,587
    Likes Received:
    62
    No idea what you're talking about.

    Are you just trying to use © ??

    That's the code that will get you the copyright symbol.
     
  3. Decker

    Decker
    Expand Collapse
    Officially Old!
    NLC

    Joined:
    Dec 19, 2003
    Messages:
    10,158
    Likes Received:
    162
    Can you show us what you can't get to work George?

    If Basekit's an editor then you should be able to open a word doc and insert/symbol and choose the © symbol then copy and paste it - I just did that there :)
     
  4. GeorgeB

    GeorgeB
    Expand Collapse
    Chairman/CEO TMCG
    NLC

    Joined:
    Jan 26, 2005
    Messages:
    2,660
    Likes Received:
    15
    I am not referring to the copyright sign. I am referring to the 2nd year in the copyright

    Copyright © 2011-2012 <<< I want the year in red to automatically change when each new year comes.

    They said the html code for it, is dynamic, and I need it to be static (or vice versa).

    The tech was talking about using PHP code that would make the HTML code static, and that w3schools.com, taught you how to do it, and was explaining, but my cell disconnected.
     
  5. Decker

    Decker
    Expand Collapse
    Officially Old!
    NLC

    Joined:
    Dec 19, 2003
    Messages:
    10,158
    Likes Received:
    162
    You mean like this;

    HTML:
    &copy; <?php 
    $copyYear = 2011; 
    $curYear = date('Y'); 
    echo $copyYear . (($copyYear != $curYear) ? '-' . $curYear : '');
    ?> Company.
    
    Which shows this;

    © 2011-2012 Company.
     
  6. GeorgeB

    GeorgeB
    Expand Collapse
    Chairman/CEO TMCG
    NLC

    Joined:
    Jan 26, 2005
    Messages:
    2,660
    Likes Received:
    15
    I would say yes, but after putting that code in, it took out both years, and just left copyright © company name.
     
  7. Decker

    Decker
    Expand Collapse
    Officially Old!
    NLC

    Joined:
    Dec 19, 2003
    Messages:
    10,158
    Likes Received:
    162
    Lets see the code you have so far :)
     
  8. GeorgeB

    GeorgeB
    Expand Collapse
    Chairman/CEO TMCG
    NLC

    Joined:
    Jan 26, 2005
    Messages:
    2,660
    Likes Received:
    15
    Here is the entire code

    <p style="text-align: center;"><span style="color: black;">Copyright &copy; <?php
    $copyYear = 2011;
    $curYear = date('Y');
    echo $copyYear . (($copyYear != $curYear) ? '-' . $curYear : '');
    ?> VIP Recycling LLC.
    A subsidiary of <span style="color: #0f00bd;"><a href="/http://millenniumcapitalcorp.com" target=
    "_blank"><span style="color: #0f00bd;">The Millennium Capital Group,
    LLC.</span></a></span></span></p>
     
  9. Decker

    Decker
    Expand Collapse
    Officially Old!
    NLC

    Joined:
    Dec 19, 2003
    Messages:
    10,158
    Likes Received:
    162
    I paste that code in and get;

    Copyright © 2011-2012 VIP Recycling LLC. A subsidiary of The Millennium Capital Group, LLC.



    (take the '/' out of <a href="/http://millenniumcapitalcorp.com" target=
    "_blank"> ;)
     
  10. GeorgeB

    GeorgeB
    Expand Collapse
    Chairman/CEO TMCG
    NLC

    Joined:
    Jan 26, 2005
    Messages:
    2,660
    Likes Received:
    15
    I had the / removed, but it got added back some how.

    Also, I have the code like that, but if you go to http://viprecycling.com/, you will notice there is no years in the footer.
     
  11. Decker

    Decker
    Expand Collapse
    Officially Old!
    NLC

    Joined:
    Dec 19, 2003
    Messages:
    10,158
    Likes Received:
    162
    Haven't tried Basekit but looking at the source code of the page it's being stripped out, or you need to insert php code in a particular way.

    I'll look at basekit and see what it does :)
     
  12. Decker

    Decker
    Expand Collapse
    Officially Old!
    NLC

    Joined:
    Dec 19, 2003
    Messages:
    10,158
    Likes Received:
    162
    Just tried it, Basekit doesn't handle php, dare say anything dynamic being added, so you'll have to take the plunge and change it once a year...
     
  13. GeorgeB

    GeorgeB
    Expand Collapse
    Chairman/CEO TMCG
    NLC

    Joined:
    Jan 26, 2005
    Messages:
    2,660
    Likes Received:
    15
    knew that nothing could be that damn easy! lol
     
  14. GeorgeB

    GeorgeB
    Expand Collapse
    Chairman/CEO TMCG
    NLC

    Joined:
    Jan 26, 2005
    Messages:
    2,660
    Likes Received:
    15
    I am surprised there is no html code for it.
     
  15. wswd

    wswd
    Expand Collapse
    Premium
    Premium Member NLC

    Joined:
    Dec 9, 2010
    Messages:
    1,587
    Likes Received:
    62
    There can't be HTML code for it, as HTML is static. You need some dynamic language for inserting dynamic content.
     
  16. GeorgeB

    GeorgeB
    Expand Collapse
    Chairman/CEO TMCG
    NLC

    Joined:
    Jan 26, 2005
    Messages:
    2,660
    Likes Received:
    15
    Yeah, I think that is what the hostgator tech was saying before my cell cut off. Unfortunately, that is nothing but GREEK to me!
     
  17. EagleAndPirate

    EagleAndPirate
    Expand Collapse
    New Member

    Joined:
    Feb 11, 2012
    Messages:
    6
    Likes Received:
    0
    Here you go.

    Dare using Javascript oO
    HTML:
    <script>
    &copy; 2011-
    <script type="text/javascript">
    var curdate = new Date()
    var year = curdate.getFullYear()
    document.write(year)
    </script>
    
     
  18. Dynash

    Dynash
    Expand Collapse
    It gets better.
    NLC

    Joined:
    Jan 21, 2008
    Messages:
    4,574
    Likes Received:
    93
    Easier:

    Code:
    <p>Copyright &copy; 2011 - <?php echo date('Y'); ?></p>
     
  19. GeorgeB

    GeorgeB
    Expand Collapse
    Chairman/CEO TMCG
    NLC

    Joined:
    Jan 26, 2005
    Messages:
    2,660
    Likes Received:
    15
    that is what I tried before.
     
  20. happyman

    happyman
    Expand Collapse
    New Member

    Joined:
    Nov 11, 2011
    Messages:
    26
    Likes Received:
    0
    This thread is the funniest thing I've read tonight, made me chuckle from top to bottom (of the thread) & glad it all got sorted out

    &copy; 2012 - <?php html/php - it's all the same nonsense!!! lol :) ?>
     

Share This Page