Re: PHP within shtml?



On Apr 28, 8:35 am, jmpatric...@xxxxxxxxx wrote:

I have a website with a PHP-based message board. The message board
has a donation tracker plug in that manages donation goals and current
donation amounts. At the top of my message board there is a
dynamically updated donation total. It uses this code to display the
information:

Amount We Need To &quot;Keep It Free&quot;: $ {$this->ipsclass->cache['donate_cache']['total_goals']}<br>

<br>
Amount Donated To Date: $ {$this->ipsclass->cache['donate_cache']
['total_donations']}

I'd like to also add this dynamically generated tally to my main
site's SHTML page. Is there a way to add PHP, using Javascript or
whatever, so that the tally grabs what it needs from the database?

Doing it the way you want (i.e., combining SSI and PHP
in a single file) is impossible (SSI and PHP are handled by
different server modules, so you can't combine SSI and PHP
code and expect the server to execute both).

What you can do is create a simple PHP script that only shows
"Amount Needed" and "Amount Donated" and show its output in an
iframe on the main (or any other) page.

A slight modification of this approach is to create an AJAX-type
widget that would request the PHP script and display its output
in a predefined location on the home page.

Cheers,
NC
.



Relevant Pages

  • c# and php conversion
    ... My webserver is running on apache + php. ... and we have a message board which the visitors can leave message to the ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: PHP within shtml?
    ... I have a website with a PHP-based message board. ... has a donation tracker plug in that manages donation goals and current ... so that the tally grabs what it needs from the database? ...
    (comp.lang.php)
  • PHP within shtml?
    ... I have a website with a PHP-based message board. ... has a donation tracker plug in that manages donation goals and current ... so that the tally grabs what it needs from the database? ...
    (comp.lang.php)
  • Re: Need to install a good bulletin board
    ... Yes PHP can be used on IIS. ... Here's a simple message board that's written in ASP.Net: ... I have a site on a shared win server and watt to install a bulletin board. ...
    (microsoft.public.windowsmedia.server)
  • Re: Best way to start learning...?
    ... I learned PHP by just getting out there and writing some program. ... remember I wrote a message board system out of PHP, ... It utilized key topics in MySQL, loops, and many other ...
    (comp.lang.php)