| Forum Home | ||||
| Press F1 | ||||
| Thread ID: 110987 | 2010-07-09 09:52:00 | Syntax Error | stormdragon (6013) | Press F1 |
| Post ID | Timestamp | Content | User | ||
| 1117390 | 2010-07-09 09:52:00 | Can somebody please tell me why I get this error with the following code? It used to work fine when running as localhost though xampp, but now that I've migrated it to a proper webhost its got issues. Parse error: syntax error, unexpected '<' in /######/footer.php on line 2 <?php> <hr class="clear" /> </div><!--/page --> </div><!--/wrapper --> <div id="footerbg"> <div id="footer"> <hr class="clear" /> </div> <!--/footer --> <div id="credits"> <div class="center">Copyright © <?php the_time('Y'); ?> Thanks |
stormdragon (6013) | ||
| 1117391 | 2010-07-09 13:12:00 | the first line declaring the php code tag shouldn't have that closing ">" it should be this <?php not <?php> and the last line <div class="center">Copyright © <?php the_time('Y'); ?> should be something like this I think <div class="center">Copyright © ?> <?php the_time('Y'); ?> |
bevy121 (117) | ||
| 1117392 | 2010-07-09 16:12:00 | Remove the entire first line - it serves no purpose, as it's just a self-closing PHP tag. This should also fix your error, unless you're piping that through eval(). The last line is fine, leave it alone - changing it to match Bevy's suggestion will break things. Finally, what the heck is the_time()? It looks like you've written a custom replacement for the built-in date formatting function - what's wrong with simply using date('Y')? |
Erayd (23) | ||
| 1117393 | 2010-07-10 01:24:00 | Hi Guys Thanks for the replies. Removing that first line fixed it. Erayd to be honest I have no idea still trying to learn php, the code simply came from a Wordpress theme that I wanted to give a whirl. |
stormdragon (6013) | ||
| 1 | |||||