I have install DirectPHP and it works fine, I can actually print out the current time with PHP, so I know it works.
My problem lies in using a custom PHP to call out variables and print out in all my articles.
First: My custom php inside /media/custom.php
<?php
// Rental Prices Equipment
$miniraeClassic_d = "$35.00";
$miniraeClassic_m = "$120.00";
$miniraeClassic_y = "$400.00";
$message = "Hello World";
?>
Second: Here is where I included the PHP file I want to retrieve information from. This was included in the index.php of my template.
// Preparing template parameters
JSNTplTemplateHelper::prepare();
// Get template utilities
$jsnutils = JSNTplUtils::getInstance();
?>
<?php
include '/media/custom.php';
?>
<!DOCTYPE html>
<!-- <?php echo $this->template . ' ' . JSNTplHelper::getTemplateVersion($this->template); ?> -->
<html lang="<?php echo $this->language ?>" dir="<?php echo $this->direction; ?>">
<head>
Third: In my article I added two codes, one trying to retrieve $message
from my custom.php
, and another to test if PHP actually works in my article (which prints out the time).
<?php
echo $message;
?>
Now is: <?php echo date('Y-m-d H:i:s');?>
Fourth: here is the result, in my article, it does not print out $message, but it does print out the date and time.
It did not print out $message
in my article, the only thing it printed out was
Now is: 2014-05-28 22:21:50
I want to call out multiple variable around my article i.e.
<table border="0" width="100%">
<tr>
<td width="32%" align="center" class="table-title"><b>Daily</b></td>
<td width="34%" align="center" class="table-title"><b>Weekly</b></td>
<td width="34%" align="center" class="table-title"><b>Monthly</b></td>
</tr>
<tr>
<td align="center" class="table-content"><?= $dayrental?></td>
<td align="center" class="table-content"><?= $weekrental?></td>
<td align="center" class="table-content"><?= $monthrental?></td>
</tr>