Code Comments
Programming Forum and web based access to our favorite programming groups.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
Post Follow-up to this messageIn 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...
Post Follow-up to this message"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
Post Follow-up to this messageOn 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.
Post Follow-up to this message"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
Post Follow-up to this messageAlso, 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
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.