 |

06-25-2004, 02:00 AM
|
|
WebProWorld Member
|
|
Join Date: May 2004
Location: USA
Posts: 38
|
|
PHP use on your Homepage?
I need some help in determining how to embed php into my index.htm file (my homepage) - is this possible?
I've been having a difficult time getting this to run, as it appears that I have to append the index page with a '.php', rather than a '.htm'. As such, my home page would not be visible.
Any help in how to accomplish embedding php into your actual homepage (index.htm), would be greatly appreciated.
Thanks.
|

06-25-2004, 09:16 AM
|
|
WebProWorld Pro
|
|
Join Date: Jul 2003
Location: New Jersey, U.S.
Posts: 293
|
|
Any page with php must have a .php extension. What is the error you are getting with your index.php page?
Joe
|

06-25-2004, 09:42 AM
|
|
WebProWorld Member
|
|
Join Date: May 2004
Location: USA
Posts: 38
|
|
PHP
I'm not getting an error on the index.php page, that runs fine. My goal is to put php in my homepage (index.htm), so that when users navigate to www.deekins.com, they will land on a page with some php in it.
From what I'm hearing, if a page has php in it, it must have a php extension, and thus, index.php (which I would be forced to name my index.htm page if I had php in it) would be my "homepage", and would not be visible to viewers unless they navigated to:
www.deekins.com/index.php
rather than:
www.deekins.com
Does my question make sense? How can one truly put php in their home page (index.htm), and have it visible to visitors?
|

06-25-2004, 09:48 AM
|
|
WebProWorld Pro
|
|
Join Date: Jul 2003
Location: New Jersey, U.S.
Posts: 293
|
|
If you replace your homepage (index.htm) with index.php visitors would see your index.php when they typed in www.deekins.com. There shouldnt be a need for anyone to type www.deekins.com/index.php
Joe
|

06-27-2004, 11:08 PM
|
|
WebProWorld Member
|
|
Join Date: May 2004
Location: USA
Posts: 38
|
|
Through some testing, I found that that is not the case. If I rename my index.htm to index.php, browers act as though there is no index page whatsoever. Thoughts?
|

06-27-2004, 11:23 PM
|
|
WebProWorld Veteran
|
|
Join Date: Apr 2004
Posts: 453
|
|
If you were on Apache you'd do
Code:
DirectoryIndex index.php index.html index.htm
in an .htaccess file.
But you're not, so I don't know how to help you.
|

06-28-2004, 12:27 AM
|
|
WebProWorld 1,000+ Club
|
|
Join Date: Jul 2003
Location: Toronto, Canada
Posts: 2,193
|
|
Hmmm, yeah you're on a Windows box.
Some Windows servers can run php.
You should contact your host to see if yours does or if they have a Unix box you can flip to.
|

06-29-2004, 12:11 AM
|
|
WebProWorld Member
|
|
Join Date: May 2004
Location: USA
Posts: 38
|
|
yes, I'm definitely on windows, and it's a windows shop, so they wouldn't have a unix box to throw me on.
Is the consensus that if I am on a windows box, that the I cannot have php in my index file, unless I specifically named the file index.php?
Thanks.
|

06-29-2004, 02:34 AM
|
|
WebProWorld 1,000+ Club
|
|
Join Date: Jul 2003
Location: Toronto, Canada
Posts: 2,193
|
|
Quote:
|
Originally Posted by deekins
yes, I'm definitely on windows, and it's a windows shop, so they wouldn't have a unix box to throw me on.
Is the consensus that if I am on a windows box, that the I cannot have php in my index file, unless I specifically named the file index.php?
Thanks.
|
Windows can handle php. But the question is.. is php installed on your Windows server? If not, will your host or server admin install it for you?
|

06-30-2004, 02:38 PM
|
|
WebProWorld 1,000+ Club
|
|
Join Date: Sep 2003
Location: Texas
Posts: 1,283
|
|
PHP in .html Pages
Just wanted to correct something that was said earlier that might come up eventually.
You can use php in an index.html, for example.
In your .htaccess (for apache, since we are talking about IIS, I'm not sure what the equivalent would be) you can just have ".html" extensions parsed as php.
...I guess I just wanted to take this opportunity to drive an otherwise great discussion off-topic...I'll go away now...
|

06-30-2004, 02:47 PM
|
|
WebProWorld 1,000+ Club
|
|
Join Date: May 2004
Location: Dallas, Texas USA
Posts: 1,564
|
|
PHP needs to be installed on the server. Then, set your home page so that it's index.php or parse the html pages as php.
|

07-06-2004, 09:32 PM
|
|
WebProWorld New Member
|
|
Join Date: Jul 2004
Location: Netherlands
Posts: 7
|
|
You can also just simply create both index.htm and index.php and create an auto redirection on the index.htm to index.php.
Also be sure that your host does actually support php. Just create a file called test.php and place
<? php_info(); ?>
In it to see if your browser would for starters already support php.
If you won't see a nice table with settings and stuff now your browser doesnt support php.
Since it's a windows server there is also be a big chance that it then might support asp. You can try a simple asp file then to check.
Another way of getting php in index.htm is putting the php in index.php and loading it in a frame in index.htm.
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|