Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PHP error
#1
I used a plug in to enable PHP in a mybb forum. When I put in this code.

PHP Code:
<?php if($this->params->get('dateDisplay')) : ?><div id="date"><?php echo date('l dS \of F Y'); ?>&nbsp;&nbsp;&nbsp;&nbsp;</div><?php endif; ?>

The date is working fine but I got two errors I got rid of one by taking out

PHP Code:
<?php endif; ?>

But im still left with this.

Code:
Parse error: syntax error, unexpected $end in /home/content/41/4149141/html/forum/global.php(438) : eval()'d code(7) : eval()'d code on line 1

If you would like to see the error here is the link to the forum

http://www.datapodcomputer.com/forum/
Reply
#2
Idk what the problem is but it just might be the way your formatted it
also do you want it to display the date everytime? if so try this
PHP Code:
<?php
echo '<div id="date">';
echo 
date('l dS \of F Y');
echo 
"&nbsp;&nbsp;&nbsp;&nbsp;</div>";
?>
if you want it to use the if (which is where your error might be) use this
PHP Code:
<?php
if($this->params->get('dateDisplay')){
echo 
'<div id="date">';
echo 
date('l dS \of F Y');
echo 
"&nbsp;&nbsp;&nbsp;&nbsp;</div>";
}
?>
Reply
#3
its not working when I input the code and hit save the entire header file
Reply
#4
I justed youed the predefined date code from mybb and then coded it into the homepage
Reply
#5
the error is caused by a missing parameter I guess.. did you put the timestamp??

PHP Code:
time(); 
I am your Father
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  PHP Framework List: An Ultimate Guide to 102 PHP Frameworks for Web Developers tk-hassan 0 786 07-27-2020, 11:26 PM
Last Post: tk-hassan
  PHP Video Tutorials (PHP For Beginners) Eleqtriq 4 3,300 10-10-2011, 01:00 PM
Last Post: Greyersting
  PHP error on page submit kaosjon 7 2,169 09-18-2011, 03:31 AM
Last Post: AceInfinity

Forum Jump:


Users browsing this thread: 2 Guest(s)