|
Posted by Jerry Stuckle on 05/11/06 15:55
Jacques Jamain wrote:
> hi Jerry,
> Wed, 10 May 2006 17:58:54 -0400
> comp.lang.php -- Jerry Stuckle <jstucklex@attglobal.net> écrivait (wrote):
>
>>Jacques Jamain wrote:
>>
>>> hello,
>>> in a dhtml page generated from php I want to include a file which is
>>> in fact the body of the dhtml page. My hosting ISP does not allow SSI
>>> but supports php includes. In the dhtml page, the generated statment
>>> <?php include('fspecs') ?>
>>> is ignored. I've the feeling that I'm overlooking something in the
>>> way php is parsing dhtml (if it does). The dhtml code saved in a file
>>> execute correctly after that...
>>> Any hints about this?
>>> Thanks in advance.
>>>
>>
>>Jacques,
>>
>>What do you mean "ignored"?
>>
>
> ... intended code in 'fspecs' not included ...
>
>
>>Have you looked at the source for the page when it gets to your browser?
>>Perhaps it's there and you don't see it.
>>
>
>
> yes, the <?php include('fspecs') ?> statment is there, well generated
> by php at server side but not processed and now it becomes obvious
> to me that it cannot be processed at client side, too late...
> My problem seems to be (or could be): "how to force php to work recursively"
> Anyway thanks to take care...
> had a good day
>
No, PHP is never processed client-side. So if you're trying to add it inline,
i.e. with echo, it won't work.
Several ways you can do this. You can use a template processor. You can use
eval to execute the code (my personal least favorite). You can write it to a
temporary file then include the file. And probably several other ways.
But why generate the statement in the first place? Why not just execute the
statement instead?
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Navigation:
[Reply to this message]
|