PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old April 28th, 2000, 06:06 AM
trollhunter trollhunter is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2000
Posts: 1 trollhunter User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hi,

I am a php newbie and I have a quite lame question: I am building my site ( http://thewearables.dynip.com ) and I would
like to include some php code in the index.html main page, but the php engine does not process it. It should be something in a configuration file. My box runs Suse Linux with Apache + php4
Thanks a lot

Reply With Quote
  #2  
Old April 28th, 2000, 08:28 AM
samplecode samplecode is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2000
Posts: 7 samplecode User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
You could add this line to your httpd.conf

AddType application/x-httpd-php3 .html

The only problem here is that it will add a slight overhead to all your .html files (they will all be processed as PHP files) but then again this means that you can always embed php script into any .html file.

------------------

Reply With Quote
  #3  
Old April 28th, 2000, 08:29 AM
ranjeet ranjeet is offline
Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2000
Location: thane
Posts: 50 ranjeet User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to ranjeet Send a message via Yahoo to ranjeet
i think u need to tell ur webserver (apache in ur case) that
DirectoryIndex index.htm index.html index.php3 index.phtml index.php

this allows ur webserver to search for index.htm/html if not found then give index.php3 file as default file to client browser

ranjeet

Reply With Quote
  #4  
Old April 28th, 2000, 08:30 AM
enygma enygma is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2000
Posts: 38 enygma User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 14
if the page has PHP code in it, it needs to have the .php3 extension on it. otherwise, i don't think that the server will parse it.
you could do a simple redirect in the index.html if you wanted to a index.php3.
that might be what you want..

Reply With Quote
  #5  
Old April 28th, 2000, 08:30 AM
samplecode samplecode is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2000
Posts: 7 samplecode User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Sorry, that might be

AddType application/x-httpd-php4 .html

(4 instead of 3 at the end) if you are using php4!

Reply With Quote
  #6  
Old April 28th, 2000, 05:19 PM
freebsd
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
>>f the page has PHP code in it, it needs to have the .php3 extension on it.
Not really.

You can even have both:
AddType application/x-httpd-php3 .php3 .htm .html
AddType application/x-httpd-php .php .php4 .html .htm

trollhunter, if most of your html documents are php and its extension is html, you should also give it a higher priority by putting it first..
DirectoryIndex index.html index.htm index.php index.php4

Putting this DirectoryIndex in .htaccess file in particular directory will override server httpd.conf file.


Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPHP Development > index.html as php file

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap