Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

extremely basic question please don't flame
If PHP files have to end in .php to get parsed, and the browser opens
the index.htm file by default, how can I embed PHP into the index.htm
file. I know I could just make a link to a .php page, but I'm trying to
get an embedded counter to funtion on the main page. Any assistance
would be greatly appreciated. I know this is simple but I'm a newbie and
couldn't find the answer to a question so basic. Thanks.

- Joshua

Report this thread to moderator Post Follow-up to this message
Old Post
Joshua James
09-26-04 01:55 AM


Re: extremely basic question please don't flame
In article <10lbuj8l4nes718@corp.supernews.com>,
Joshua James <joshua@tech9.org> wrote:

> If PHP files have to end in .php to get parsed, and the browser opens
> the index.htm file by default, how can I embed PHP into the index.htm
> file. I know I could just make a link to a .php page, but I'm trying to
> get an embedded counter to funtion on the main page. Any assistance
> would be greatly appreciated. I know this is simple but I'm a newbie and
> couldn't find the answer to a question so basic. Thanks.
>
> - Joshua

You can't, AFAIK.  If your apache web server isn't configured to open
index.php as well as index.{html,shtml,htm}, then you're out of luck.
I'm unfamiliar with other servers, but that's the way apache works.
Also, you could run a "server-side include" to run a perl script to do
the counter, but again, your server has to be configured to do these
things.  I suggest reading the docs on your server's configuration.

If you're not the webmaster and can't configure it, you're SOL and will
have to be content with CGI.  If you don't even have that (like my pages
on comcast.net), then find a true web hosting company.

--
DeeDee, don't press that button!  DeeDee!  NO!  Dee...




Report this thread to moderator Post Follow-up to this message
Old Post
Michael Vilain
09-26-04 08:55 AM


Re: extremely basic question please don't flame
"Michael Vilain <vilain@spamcop.net>" wrote:
> In article <10lbuj8l4nes718@corp.supernews.com>,
>  Joshua James <joshua@tech9.org> wrote:
>
> 
>
>
> You can't, AFAIK.  If your apache web server isn't configured to open
> index.php as well as index.{html,shtml,htm}, then you're out of luck.
> I'm unfamiliar with other servers, but that's the way apache works.
> Also, you could run a "server-side include" to run a perl script to do
> the counter, but again, your server has to be configured to do these
> things.  I suggest reading the docs on your server's configuration.
>
> If you're not the webmaster and can't configure it, you're SOL and will
> have to be content with CGI.  If you don't even have that (like my pages
> on comcast.net), then find a true web hosting company.
>

Thanks, it turns out my hoting service supports index.php. I was under
the impression that which index to open was up to the browser, and it
defaulted to index.htm or .html. Apparently this is left up to the
server. Duh. Oh well, thanks, I was wracking my brain until I got it fixed.

-Joshua

Report this thread to moderator Post Follow-up to this message
Old Post
Joshua James
09-26-04 08:55 AM


Re: extremely basic question please don't flame
On Sat, 25 Sep 2004 23:42:19 -0400 (more or less), Joshua James
<joshua@tech9.org> wrote:

>
>Thanks, it turns out my hoting service supports index.php. I was under
>the impression that which index to open was up to the browser, and it
>defaulted to index.htm or .html. Apparently this is left up to the
>server. Duh. Oh well, thanks, I was wracking my brain until I got it fixed.
>
>-Joshua

It may be possible to override the default ordering set at the top level of
the server with an .htaccess file, too.

Report this thread to moderator Post Follow-up to this message
Old Post
Steven Stern
09-26-04 02:06 PM


Re: extremely basic question please don't flame
"Michael Vilain <vilain@spamcop.net>" wrote:
> In article <10lbuj8l4nes718@corp.supernews.com>,
>  Joshua James <joshua@tech9.org> wrote:
>
> 
>
>
> You can't, AFAIK.  If your apache web server isn't configured to open
> index.php as well as index.{html,shtml,htm}, then you're out of luck.
> I'm unfamiliar with other servers, but that's the way apache works.
> Also, you could run a "server-side include" to run a perl script to do
> the counter, but again, your server has to be configured to do these
> things.  I suggest reading the docs on your server's configuration.
>
> If you're not the webmaster and can't configure it, you're SOL and will
> have to be content with CGI.  If you don't even have that (like my pages
> on comcast.net), then find a true web hosting company.
>
Not at all the default page is supplied by a configuration directive.
If the server is configured to allow overides or a limit of overides you
can change this with an .htaccess file.

A quick test would be to create a text file called .htaccess
place it in the directory where you want php to run

The text file should have this line in it


DirectoryIndex index.php index.html index.htm default.php default.html
default.htm


This will allow the following pages to be the default in order of
preference.


Jeff Thompson

Report this thread to moderator Post Follow-up to this message
Old Post
Jeff Thompson
09-26-04 08:55 PM


Re: extremely basic question please don't flame
Also, as a last ditch effort you could use a "meta-refresh" to send the user
to the php page you want to use as the index.

-Charles

"Jeff Thompson" <news@ninthwave.us> wrote in message
news:cj6gob$cq5$1$8302bc10@news.demon.co.uk...
> "Michael Vilain <vilain@spamcop.net>" wrote: 
> Not at all the default page is supplied by a configuration directive.
> If the server is configured to allow overides or a limit of overides you
> can change this with an .htaccess file.
>
> A quick test would be to create a text file called .htaccess
> place it in the directory where you want php to run
>
> The text file should have this line in it
>
>
> DirectoryIndex index.php index.html index.htm default.php default.html
> default.htm
>
>
> This will allow the following pages to be the default in order of
> preference.
>
>
> Jeff Thompson



Report this thread to moderator Post Follow-up to this message
Old Post
Charles Pelkey
09-27-04 01:55 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PHP Language archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 05:22 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.