Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

index page query from PHP newbie

0 views
Skip to first unread message

KiwiBrian

unread,
May 30, 2005, 11:50:24 AM5/30/05
to
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?
TIA
Brian Tozer


Anonymous

unread,
May 30, 2005, 12:35:54 PM5/30/05
to

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!

Geoff Berrow

unread,
May 30, 2005, 12:57:50 PM5/30/05
to
I noticed that Message-ID: <d7fcnk$5gb$1...@lust.ihug.co.nz> from KiwiBrian
contained the following:

>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?

The easy option is to name it index.php and change all other links
accordingly.

--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/

KiwiBrian

unread,
May 30, 2005, 1:21:10 PM5/30/05
to

"KiwiBrian" <bria...@ihug.co.nz> wrote in message
news:d7fcnk$5gb$1...@lust.ihug.co.nz...

Thanks folks for the replies so far.
I was hoping that my Home Page link could go to a special page which had a
.php extension and contained the appropriate snippet of php and was
automatically actioned.
Is this another option?
I use this method at present to funnel all outgoing links to a site that I
want to monitor the number of visits to from my site using Statcounter.
If this method is an option, what would I need in my intermediate page in
place of the a href link, which in testing I have triggered manually.
I hope I am being clear.
TIA
Brian Tozer


Tony

unread,
May 30, 2005, 11:49:24 PM5/30/05
to
"KiwiBrian" <bria...@ihug.co.nz> wrote in message
news:d7fi1q$f1v$1...@lust.ihug.co.nz...

If you're set on keeping the HTML extension, all I could suggest is using
JavaScript instead of PHP.


Stan McCann

unread,
May 31, 2005, 3:36:59 PM5/31/05
to
"Tony" <som...@somewhere.not> wrote in
news:119nnlu...@corp.supernews.com:

> "KiwiBrian" <bria...@ihug.co.nz> wrote in message
> news:d7fi1q$f1v$1...@lust.ihug.co.nz...

>> Thanks folks for the replies so far.


>> I was hoping that my Home Page link could go to a special page
>> which had a .php extension and contained the appropriate snippet of
>> php and was automatically actioned.
>> Is this another option?
>> I use this method at present to funnel all outgoing links to a site
>> that I want to monitor the number of visits to from my site using
>> Statcounter. If this method is an option, what would I need in my
>> intermediate page in place of the a href link, which in testing I
>> have triggered manually. I hope I am being clear.
>> TIA
>> Brian Tozer
>
> If you're set on keeping the HTML extension, all I could suggest is
> using JavaScript instead of PHP.

Or set index.html as simply a redirect to index.php?

You'd get better help if you would explain what you are trying to
accomplish. Is there some specific reason for not changing index.html
to index.php? A lot of links hard coded to index.html for instance?
If that is the reason, a redirect should work.

--
Stan McCann "Uncle Pirate" http://stanmccann.us/pirate.html
Webmaster/Computer Center Manager, NMSU at Alamogordo
http://alamo.nmsu.edu/ There are 10 kinds of people.
Those that understand binary and those that don't.

0 new messages