PDA

View Full Version : Mac Views Copyright script incorrectly


SimplySally
09-11-2007, 12:34 AM
I have two scripts that will update the copyright on a page...one is javascript and one is php...
For some reason Mac folks see it as Sally©107;
and not Sally©2007; and it is the same for both scripts.........

Can anyone shed light on this for me?? I do not have or have access to a Mac...but there must be some reason for this and hopefully a fix??

SimplySally
09-11-2007, 12:36 AM
Pardon my manners...Thanks in advance for any light on this..Sally

_Aerospace_Eng_
09-11-2007, 12:57 AM
We need to see the codes you are using. This also really should have been posted in the php forum rather than this forum.

SimplySally
09-11-2007, 04:40 AM
Thanks for your response...

Sorry....I guess I did not think of it as a code problem. Only Mac Safari is seeing it as ©107

But here are both codes, Safari sees them both as above..

http://www.simplysally.com/temp/copy.txt

Thanks!!

_Aerospace_Eng_
09-11-2007, 06:04 AM
Try these
<script type="text/javascript">
var now = new Date();
var year = now.getFullYear();
document.write('<font size="1">SimplySally© '+year+'</font>');
</script>
<?php
function copyright($site) {
$current = date(Y);
echo "All content &copy; $current $site";
}
?>
Firefox for PC was also seeing ©107 but it was getting the php one right. I modified the php one to what I think it is what you more or less wanted.

SimplySally
09-12-2007, 06:45 PM
Thanks so much....but I can not get either of those to work at all....Maybe I just need more coffee..??

_Aerospace_Eng_
09-12-2007, 06:53 PM
Thanks so much....but I can not get either of those to work at all....Maybe I just need more coffee..??

I just tested both, and they work, can you post a link to your site.

felgall
09-13-2007, 09:06 AM
check that you are using getFullYear() rather than getYear() in JavaScript as the getYear one is deprecated as it is not Y2K compliant.

Doesn't the 'Y' in the PHP version need to be in quotes?

$current = date('Y');

_Aerospace_Eng_
09-13-2007, 03:54 PM
Hmm you are right though it seemed to work just fine on my testing server without quotes.

Sally does this work for you?
http://prod.freehostia.com/test.php

SimplySally
09-15-2007, 03:47 AM
Thanks guys...Yes that works for me...after making sure I had getFullYear, and putting the 'y' in the quotes....same results....neither one works and I'm sure it's me...!!

PHP
http://www.simplysally.com/arts/CODEFORUMS.php
http://www.simplysally.com/arts/Codeforums.txt

Javascript
http://www.simplysally.com/arts/CODEFORUMS2.php
http://www.simplysally.com/arts/Codeforums2.txt

Thanks....!!!

_Aerospace_Eng_
09-15-2007, 03:46 PM
There are some issues with the way your comments are in your javascript. This is what currently works. Just copy and paste it, lose the comments and don't try to rewrite it.
<script type="text/javascript">
var now = new Date();
var year = now.getFullYear();
document.write('<font size="1">SimplySally &copy; '+year+'</font>');
</script>
<?php
function copyright($site) {
$current = date('Y');
echo "All content &copy; $current $site";
}
copyright('http://site.com');
?>

SimplySally
09-15-2007, 10:05 PM
I put the comments in the Javascript because it didn't work without them...and it still doesn't. But it doesn't work with them either....so I have no clue....I see the entire code on the page.

http://www.simplysally.com/arts/CODEFORUMS.php
http://www.simplysally.com/arts/CODEFORUMS.txt


Now as to the php...it also still does not work..I have no clue about this either.

http://www.simplysally.com/arts/CODEFORUMS2.php
http://www.simplysally.com/arts/CODEFORUMS2.txt

Just seems odd.....Thanks for all your help!!!!

_Aerospace_Eng_
09-15-2007, 10:09 PM
The javascript should work without the comments. As I said before the code I used works fine and there are NO comments in it.

I can't see the php in any of the text files because they redirect you back to the main site.

SimplySally
09-17-2007, 02:35 AM
Sorry, I am the typo queen...!! Thanks for your patience!!!

I CCP the javascript and never touched it...
http://www.simplysally.com/arts/CODEFORUMS.php
http://www.simplysally.com/arts/Codeforums.txt

http://www.simplysally.com/arts/CODEFORUMS2.php
http://www.simplysally.com/arts/Codeforums2.txt

SimplySally
09-17-2007, 02:49 AM
This is what I see on your page...all on one line the first SimplySally©2007 is in tiny text maybe 1 and the rest is in bigger text 3possibly...

SimplySally © 2007 All content © 2007 http://site.com

Maybe it is just best to leave well enough alone and the Safari people will have to guess...! Thanks...!!!