Hi Ken,
>> I would like to run some PHP in the XHtml to post code based on a condition.
The short answer is - this is the wrong approach.
PHP is a server side language. In other words it is parsed through a PHP engine before being sent to the client.
But in a NetTalk app you alreayd have a server side language (ie Clarion) so "embedding" PHP like this is overkill.
The correct approach is to port your PHP test into clarion.
So using the example below;
a) add an item to the xHtml tab - doesn't matter what you put in there, the goal is to see how the text in there is handled.
b) right click on the procedure, and choose "Source". search for the routine name specified in step a.
You should see a call to it, and the declaration of it.
c) In the routine, in the embed before the assignment, put your own code to print the packet variable. ie it might look something like;
If instring('test',something,1,1)
packet = '<img src="images/test01.png"/>'
else
packet = '<img src="images/test02.png"/>'
end
As an aside, you can not put PHP into the header anyway, because the PHP engine only reads html "whole pages" off the disk. it can't handle "snippets" of PHP generated into dynamic content. But fortunately this should never be required anyway.
Cheers
Bruce
I wanted to test this using the example in the PHP (58) folder (which I renamed to PHP) for this. The "pattern.php" runs just fine, but the same code in the XHtml tab in the MailboxesFormControl does not run in the example. It prints the code after the "print" command.