This topic is locked

Adding PHP to template files?

8/17/2007 11:01:45 AM
PHPRunner General questions
N
ncfpoozer author

Hello,
When viewing the database records list (so the #####_list.php) I have a PhotoID field.
I would like it so that when PhotoID field has a value (anything not NULL), for a border to show up around the "View Record" (link to the #####_view.php) button. When the PhotoID is NULL, I'd just like the View Record to show up as normal, without a border.
So simplified it would be something like this in PHP
<?php

$d={$row.1PhotoID_value};

if ($d=="")

echo "View Record";

else

echo "View Record2";

?>
However this does not work (as I would somewhat expect), it just places that php code into the HTML page as text.
How would I do this correctly?

Thanks.

Sergey Kornilov admin 8/17/2007

In PHPRunner 4.1 you have two options:

  1. Use View as type Custom where you can put any PHP code
  2. Use Insert PHP code snippet in Visual Editor.