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 #172907 is a reply to message #172902] Fri, 11 March 2011 14:47 Go to previous messageGo to previous message
Erwin Moller is currently offline  Erwin Moller
Messages: 228
Registered: September 2010
Karma:
Senior Member
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
[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: Wed Nov 27 04:13:32 GMT 2024

Total time taken to generate the page: 0.04253 seconds