Re: Include php from html



It is most definitely possible to include a PHP counter in an HTML file
because I have been doing it for years. In my HTML file I include a link as
follows:

<p><img src="http://www.mydomain.com/counter.php?page=/whatever.html";
alt="counter" border="0"></p>

The PHP script 'counter.php' uses the 'page=' argument to identify which
document to count, then outputs the result as an image.

Easy peasy lemon squeezy.

--
Tony Marston

http://www.tonymarston.net



"Luke Bellamy" <bellamy_luke@xxxxxxxxxxx> wrote in message
news:3cab9daf.0504281916.68454042@xxxxxxxxxxxxxxxxxxxxx
> Hi - I have been asked to add a hit counter to a standard HTML page.
> I have found a php script to implement the counter but need to show it
> on the html page.
> I cannot include a PHP in the html file can I? the web server will not
> pre-parse a html file correct?
>
> I would like to put the PHP hit counter on the web site that only
> contains html files. Anyone have a good idea how I can do this without
> chaning all the files to .php?
>
> Thanks,
> Luke Bellamy
> Newcastle, Australia


.



Relevant Pages

  • Re: Writing data to HTML file BEFORE the tag.
    ... which then appends the user comments to the ... end of the HTML file on which the form is located. ... This PHP code ... The exit call here will prevent the script from returning a complete ...
    (comp.lang.php)
  • Re: HTML/PHP include files
    ... not sure if this is the problem but your two php files are different: ... see if its the problem by copying your includes dir to the jennifer dir and ... or use the absolute paths above(make sure to delete jennifer/includes so you ... I thought that I could include an html file from a php statement ...
    (alt.html)
  • Re: Can PHP be used to write permanent file changes?
    ... perl, php, cgi or something else so I was wondering what you would ... write the new html file on the server? ... Something to process user submissions and store them ... PHP has no problem writing an HTML file ...
    (php.general)
  • Re: Change included code
    ... Index.php is basically an html file uses a linked css file and when its included in the new file its referencing a css file in the wrong spot. ... It would actually be a bit more trouble since any time I want to upload to the server to test I will have to change the link. ... Would be easier just to have php just add "../" to one spot instead manually doing it every time I upload to the server. ...
    (comp.lang.php)
  • Re: Change included code
    ... its included in the new file its referencing a css file in the ... upload to the server to test I will have to change the link. ... be easier just to have php just add "../" to one spot instead ... in the main html file I have ...
    (comp.lang.php)