WebProWorld Part of WebProNews.com
Page One Link To Us Edit Profile Private Messages Archives FAQ RSS Feeds  
 

Go Back   WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Subscribe to the Newsletter FREE!


Register FAQ Members List Calendar Arcade Chatbox Mark Forums Read

Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-25-2004, 02:00 AM
WebProWorld Member
 

Join Date: May 2004
Location: USA
Posts: 38
deekins RepRank 0
Default 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.
Reply With Quote
  #2 (permalink)  
Old 06-25-2004, 09:16 AM
WebProWorld Pro
 

Join Date: Jul 2003
Location: New Jersey, U.S.
Posts: 293
jdiben RepRank 0
Default

Any page with php must have a .php extension. What is the error you are getting with your index.php page?

Joe
Reply With Quote
  #3 (permalink)  
Old 06-25-2004, 09:42 AM
WebProWorld Member
 

Join Date: May 2004
Location: USA
Posts: 38
deekins RepRank 0
Default 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?
Reply With Quote
  #4 (permalink)  
Old 06-25-2004, 09:48 AM
WebProWorld Pro
 

Join Date: Jul 2003
Location: New Jersey, U.S.
Posts: 293
jdiben RepRank 0
Default

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
Reply With Quote
  #5 (permalink)  
Old 06-27-2004, 11:08 PM
WebProWorld Member
 

Join Date: May 2004
Location: USA
Posts: 38
deekins RepRank 0
Default

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?
Reply With Quote
  #6 (permalink)  
Old 06-27-2004, 11:23 PM
WebProWorld Veteran
 

Join Date: Apr 2004
Posts: 453
HardCoded RepRank 0
Default

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.
Reply With Quote
  #7 (permalink)  
Old 06-28-2004, 12:27 AM
WebProWorld 1,000+ Club
 

Join Date: Jul 2003
Location: Toronto, Canada
Posts: 2,193
cyanide RepRank 0
Default

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.
__________________
|
Web Hosting Guru
| Need Help For Your Forum?
Reply With Quote
  #8 (permalink)  
Old 06-29-2004, 12:11 AM
WebProWorld Member
 

Join Date: May 2004
Location: USA
Posts: 38
deekins RepRank 0
Default

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.
Reply With Quote
  #9 (permalink)  
Old 06-29-2004, 02:34 AM
WebProWorld 1,000+ Club
 

Join Date: Jul 2003
Location: Toronto, Canada
Posts: 2,193
cyanide RepRank 0
Default

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?
__________________
|
Web Hosting Guru
| Need Help For Your Forum?
Reply With Quote
  #10 (permalink)  
Old 06-30-2004, 02:38 PM
WebProWorld 1,000+ Club
 

Join Date: Sep 2003
Location: Texas
Posts: 1,283
flood6 RepRank 0
Default 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...
Reply With Quote
  #11 (permalink)  
Old 06-30-2004, 02:47 PM
WebProWorld 1,000+ Club
 

Join Date: May 2004
Location: Dallas, Texas USA
Posts: 1,564
bhartzer RepRank 1
Default

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.
__________________
Bill Hartzer's Blog
Reply With Quote
  #12 (permalink)  
Old 07-06-2004, 09:32 PM
WebProWorld New Member
 

Join Date: Jul 2004
Location: Netherlands
Posts: 7
Psycho Dude RepRank 0
Default

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.
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Tags: , ,



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Search Engine Optimization by vBSEO 3.2.0