Adding php code gets error..

Hello.

So i just simple added this PHP code into a PHP block:

[code]

<?php

// starting level
$startingLevel = 1340 ; 

// increment amount (every minute)
$increment = 0.5 ;

$currentAmount = number_format ($startingLevel + (time() -                 1337516434        )/60 * $increment, 2) ;

echo "Total paid ".  $currentAmount . " dollars paid out";

?>

[/code]

After i have added the code into PHP block, it gives this error:

Parse error: syntax error, unexpected '<' in/home/e180/public_html/inc/classes/BxDolPageView.php(607) : eval()'d code on line 1


Way to fix it?

Quote · 20 May 2012

Try taking the "<?php" and "?>" out..

BoonEx Certified Host: Zarconia.net - Fully Supported Shared and Dedicated for Dolphin
Quote · 20 May 2012

PHP blocks are processed by the php eval function. As php is already started and a block is just a continuation you cannot use starting and ending tags.

Example..

WRONG WAY
<?php
echo 'test';
?>

RIGHT WAY
echo 'test';


https://www.deanbassett.com
Quote · 20 May 2012

lol solved the problem.

Quote · 20 May 2012
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.