Re: index page query from PHP newbie



KiwiBrian wrote:
>
> On my index.html page I wish to have a link called "Today's message" that
> contains a bit of PHP to fetch the message of the day.
> I have this working from a daughter test page which has the extension .php.
> When I implement this link from my Home Page I want the Home Page to still
> be named index.html
> How would I implement my desired operation?

Not at all.

Assuming your page is on a provider's server you do not have access to
the server configuration which you would have to change to get the
server to run .html files through PHP.
This is undesirable behaviour because the server would have to process
all .html pages without PHP code through PHP, not just your page. This
puts a lot of additional stress on a high profile webserver.

Why don't you rename your file to index.php? Most servers are configured
to look for an index.php if there is no index.html or index.htm.

Bye!
.



Relevant Pages

  • Re: PHP Instalation problems. Browser doesnt know what to do
    ... This is loaded and run as a local server (for class ... PHP 5.2.0 from php-5.2.0-win32-installer.msi ... # configuration directives that give the server its instructions. ...
    (comp.lang.php)
  • Re: PHP Instalation problems. Browser doesnt know what to do
    ... This is loaded and run as a local server (for class ... PHP 5.2.0 from php-5.2.0-win32-installer.msi ... # configuration directives that give the server its instructions. ...
    (comp.lang.php)
  • Re: redirect / new website how to redirect old (google) links to new site ?
    ... But why use PHP for some other function such as processing form data. ... to process *all* .html files as php files is an unnecessary overhead. ... That's what a server is for. ... You only need an extension if you directly map a URL onto the server's ...
    (comp.lang.php)
  • Re: write with cURL
    ... execute permissions. ... This is assuming that the PHP script runs ... of potential security risks from other users on the same server. ... Apache as the global web server user and thus needs world write ...
    (alt.php)
  • mysqli error?
    ... I'm just setting up my php enviroment and I typed in a simple script ... # configuration directives that give the server its instructions. ...
    (comp.lang.php)