View Full Version : php/html copyright year code
GeorgeB
January 18th, 2012, 20:42
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.
wswd
January 18th, 2012, 21:09
No idea what you're talking about.
Are you just trying to use © ??
That's the code that will get you the copyright symbol.
Decker
January 19th, 2012, 06:22
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 :)
GeorgeB
January 19th, 2012, 07:13
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.
Decker
January 19th, 2012, 08:30
You mean like this;
© <?php
$copyYear = 2011;
$curYear = date('Y');
echo $copyYear . (($copyYear != $curYear) ? '-' . $curYear : '');
?> Company.
Which shows this;
© 2011-2012 Company.
GeorgeB
January 19th, 2012, 08:44
I would say yes, but after putting that code in, it took out both years, and just left copyright © company name.
Decker
January 19th, 2012, 08:46
Lets see the code you have so far :)
GeorgeB
January 19th, 2012, 08:57
Lets see the code you have so far :)
Here is the entire code
<p style="text-align: center;"><span style="color: black;">Copyright © <?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>
Decker
January 19th, 2012, 09:20
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"> ;)
GeorgeB
January 19th, 2012, 09:25
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"> ;)
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.
Decker
January 19th, 2012, 10:09
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 :)
Decker
January 19th, 2012, 10:23
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...
GeorgeB
January 19th, 2012, 11:16
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...
knew that nothing could be that damn easy! lol
GeorgeB
January 19th, 2012, 11:18
I am surprised there is no html code for it.
wswd
January 19th, 2012, 16:06
I am surprised there is no html code for it.
There can't be HTML code for it, as HTML is static. You need some dynamic language for inserting dynamic content.
GeorgeB
January 20th, 2012, 20:37
There can't be HTML code for it, as HTML is static. You need some dynamic language for inserting dynamic content.
Yeah, I think that is what the hostgator tech was saying before my cell cut off. Unfortunately, that is nothing but GREEK to me!
EagleAndPirate
February 11th, 2012, 18:15
Dare using Javascript oO
<script>
© 2011-
<script type="text/javascript">
var curdate = new Date()
var year = curdate.getFullYear()
document.write(year)
</script>
Dynash
February 13th, 2012, 07:44
Easier:
<p>Copyright © 2011 - <?php echo date('Y'); ?></p>
GeorgeB
February 18th, 2012, 19:27
Easier:
<p>Copyright © 2011 - <?php echo date('Y'); ?></p>
that is what I tried before.
happyman
April 12th, 2012, 16:46
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
© 2012 - <?php html/php - it's all the same nonsense!!! lol :) ?>
sarmth
April 29th, 2012, 23:01
You can use Javascript, but that only draws upon the date and time information of the Client Computer. Otherwise, the example provided by Decker is quite adequate.
willson
May 4th, 2012, 01:21
This one is quite easier <p>Copyright © 2011 - <?php echo date('Y'); ?></p>
Powered by vBulletin® Version 4.1.7 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.