Home > Archive > PHP Language > September 2004 > extremely basic question please don't flame
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
extremely basic question please don't flame
|
|
| Joshua James 2004-09-25, 8:55 pm |
| 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
| |
| Michael Vilain 2004-09-26, 3:55 am |
| 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...
| |
| Joshua James 2004-09-26, 3:55 am |
| "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
| |
| Steven Stern 2004-09-26, 9:06 am |
| 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.
| |
| Jeff Thompson 2004-09-26, 3:55 pm |
| "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
| |
| Charles Pelkey 2004-09-26, 8:55 pm |
| 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
|
|
|
|
|