Re: How to call external php script from html? [message #172908 is a reply to message #172907] |
Fri, 11 March 2011 15:05 |
astral
Messages: 14 Registered: February 2011
Karma:
|
Junior Member |
|
|
"Erwin Moller"
<Since_humans_read_this_I_am_spammed_too_much(at)spamyourself(dot)com> wrote in
message news:4d7a35f5$0$41102$e4fe514c(at)news(dot)xs4all(dot)nl...
> On 3/11/2011 2:51 PM, astral wrote:
>> How to call external php file from html page? Renaming page from .html
>> to .php not suitable due many reasons. Modifying .htaccess file to make
>> the PHP executable on the .html pages also not suitable. Calling PHP
>> script from an external javascript not work:
>> <script type="text/javascript"
>> src="http://www.domain.com/file.php"></script>
>> Calling from Iframe work, but its too ugly, I need specify width/height
>> for iframe, whereas php script need display html output without iframe
>> limitations.
>> <iframe src="http://www.domain.com/file.php" width="600"
>> height="300"></iframe>
>>
>> I there some other method?
>>
>
> Hi,
>
> If you just want to call a PHP script every time your HTML page is
> requested, you could do something like:
> [HTML page]
> <img src="http://www.example.com/yourphpscript.php">
>
> That way that script is called exactly 1 time for each time the HTML page
> is requested.
>
> Alternatively use JavaScript to fetch an image, but that will fail of
> course if JavaScript is turned off.
>
> Pay attention to aggressive caching strategies by the browser to make sure
> it is called every time.
> (Maybe let the PHP script return a valid 1x1 image with appropriate
> headers.)
>
> Regards,
> Erwin Moller
>
> --
> "That which can be asserted without evidence, can be dismissed without
> evidence."
> -- Christopher Hitchens
--------------------
I use cURL php script to extract html content from remote site and display
it on my html page, so need execute this php script from my html page.
Can you clarify about fetching an image with Javascript method?
Regards,
astral
|
|
|