Bizarre PHP (HTML Object) behaviour
October 11, 2015 12:00 AM
I am experimenting with html objects.
I am trying to insert PHP code into an HTML (PHP) object. I can do so either manually through the editor or by selecting a file. The code that I want to run is very simple:
Discussion (5)
I finally tweaked to the fact that my php code was not being interpreted as php - but just as plain html.
So... how do I force an interpretation as php? Clearly my server is made to understand and interpret php. It's just that when I put into this lectora object it does not get it. Hmmm...
Mystery partially solved:
Lectora was not producing the .php file that it said it would produce.
I am not sure why it had a problem. However the following may be true:
I was using the embedded object on the first page of the title. When I moved the object to the third page, it created the file. I have not yet tested whether it will successfully go from page 1 to page 2 to page 3 (the php page).
Lectora was not producing the .php file that it said it would produce.
Could you point me to where Lectora promised to produce a PHP file? AFAIK Lectora only produces HTML files. But you can always configure your web server to run PHP code inclusions in HTML files via htaccess.
Hi Sergey,
Nice to hear from you.
Here is the quote (p. 260 of the PDF manual):
PHP Script Use this object type to insert your own PHP script. Your custom code will be placed within a undefined block in the body of the HTML page. The HTML page will be published with an extension of .php.
And in fact, when I experimented with it in a new title, it did produce a .php file - and when the php extension was removed, it reverted to creating a .html file although (I think) it did not remove the previously-created php file. Take a look at the attached graphic: page3.php was created by Lectora.

Discussions have been disabled for this post