WebSite X5Help Center

 
Matthew S.
Matthew S.
User

How to add custom PHP code in a page  en

Autor: Matthew S.
Visited 1832, Followers 1, Udostępniony 0  

What is method to add PHP code into a text block or HTML object?

The code:

-------------------

<?php

// add sample PHP code here

$data1 = 35;

$data2 = 2;

$result = $data1 + $data2;

echo "Calculated value = ".$result;

?>

-------------------

does not work in text box with HTML enabled or in the HTML object.

The custome PHP code would make calculations or look up values dynamically.

Any ideas?

Posted on the
3 ODPOWIEDZI - 1 PRAWIDłOWA ODPOWIEDź
JJ. JUAG
JJ. JUAG
User

The page (page name) where you insert this code must be changed to xxx.php not xxx.html,
so that php runs on the server.

JJ.

Czytaj więcej
Posted on the from JJ. JUAG
JJ. JUAG
JJ. JUAG
User

Where: Sitemap - Page - Properties - Advanced - Filename format

JJ.

Czytaj więcej
Posted on the from JJ. JUAG
Matthew S.
Matthew S.
User
Autor

Thanks, that was the missing piece!

Czytaj więcej
Posted on the from Matthew S.