FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » How to call external php script from html?
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: How to call external php script from html? [message #172908 is a reply to message #172907] Fri, 11 March 2011 15:05 Go to previous messageGo to previous message
astral is currently offline  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
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Lookup zip by IP address
Next Topic: browser url with #...
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Sep 20 06:33:22 GMT 2024

Total time taken to generate the page: 0.05632 seconds