Forum Articles
  Welcome back Join CF
You are here You are here: Home | Forum | PHP within HTML pages

You are currently viewing our boards as a guest which gives you limited access to view most of the discussions, articles and other free features. By joining our Virgin Media community you will have full access to all discussions, be able to view and post threads, communicate privately with other members (PM), respond to polls, upload your own images/photos, and access many other special features. Registration is fast, simple and absolutely free so please join our community today.


Welcome to Cable Forum
Go Back   Cable Forum > Computers & IT > Internet Discussion
Register FAQ Community Calendar

PHP within HTML pages
Reply
 
Thread Tools
Old 09-08-2004, 21:50   #1
Tricky
Inactive
 
Tricky's Avatar
 
Join Date: Jun 2003
Location: I am house...
Services: $KY+HD - BT Infinity
Posts: 2,284
Tricky is the helpful oneTricky is the helpful oneTricky is the helpful oneTricky is the helpful oneTricky is the helpful oneTricky is the helpful oneTricky is the helpful oneTricky is the helpful oneTricky is the helpful oneTricky is the helpful oneTricky is the helpful oneTricky is the helpful oneTricky is the helpful oneTricky is the helpful oneTricky is the helpful oneTricky is the helpful oneTricky is the helpful one
PHP within HTML pages

Might be a daft question?:

Can I have a .htm or .html page with embedded php code?
I am currently trying to test this with some very basic code:

PHP Code:
<body>
<? echo("Hello"); ?>
</body>
This results in nothing on screen saved as a .htm or html but works on a .PHP save - this is on my own server but also on www.i-websolutions.co.uk

Either that or can someone confirm that .php pages will be indexed by search engines/robots/etc. including the follow links
Tricky is offline   Reply With Quote
Advertisement
Old 09-08-2004, 22:01   #2
Bifta
Inactive
 
Join Date: Jul 2003
Location: Eglinton, Co. Derry
Posts: 7,640
Bifta has a nice shiny starBifta has a nice shiny star
Bifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny star
Re: PHP within HTML pages

PHP code will only run if the file suffix indicates it's a PHP file, the same rule for SHTML and SSI. PHP files do however get indexed by search engines, certainly google indexes them.
Bifta is offline   Reply With Quote
Old 09-08-2004, 22:04   #3
Tricky
Inactive
 
Tricky's Avatar
 
Join Date: Jun 2003
Location: I am house...
Services: $KY+HD - BT Infinity
Posts: 2,284
Tricky is the helpful oneTricky is the helpful oneTricky is the helpful oneTricky is the helpful oneTricky is the helpful oneTricky is the helpful oneTricky is the helpful oneTricky is the helpful oneTricky is the helpful oneTricky is the helpful oneTricky is the helpful oneTricky is the helpful oneTricky is the helpful oneTricky is the helpful oneTricky is the helpful oneTricky is the helpful oneTricky is the helpful one
Re: PHP within HTML pages

Cheers m8 - I'll stop pulling php.ini and httpd.conf in pieces now!
It was the indexing that I was bothered about - I am assuming that META tags in PHP files will be referenced in the same manner?
Tricky is offline   Reply With Quote
Old 09-08-2004, 22:07   #4
Bifta
Inactive
 
Join Date: Jul 2003
Location: Eglinton, Co. Derry
Posts: 7,640
Bifta has a nice shiny starBifta has a nice shiny star
Bifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny starBifta has a nice shiny star
Re: PHP within HTML pages

Quote:
Originally Posted by Tricky
Cheers m8 - I'll stop pulling php.ini and httpd.conf in pieces now!
It was the indexing that I was bothered about - I am assuming that META tags in PHP files will be referenced in the same manner?
Yeah, there's no reason why they wouldn't be, the spider/engine will just read whatever client side code it can get at.
Bifta is offline   Reply With Quote
Old 09-08-2004, 23:17   #5
Richard M
Inactive
 
Join Date: Jun 2003
Location: Los Angeles, CA
Age: 47
Posts: 6,343
Richard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze array
Richard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze arrayRichard M has a bronze array
Re: PHP within HTML pages

Actually all you need to do is put this in a .htaccess file and upload it to the root of your public webspace:

AddType application/x-httpd-php .html .htm
Richard M is offline   Reply With Quote
Old 10-08-2004, 10:30   #6
Tricky
Inactive
 
Tricky's Avatar
 
Join Date: Jun 2003
Location: I am house...
Services: $KY+HD - BT Infinity
Posts: 2,284
Tricky is the helpful oneTricky is the helpful oneTricky is the helpful oneTricky is the helpful oneTricky is the helpful oneTricky is the helpful oneTricky is the helpful oneTricky is the helpful oneTricky is the helpful oneTricky is the helpful oneTricky is the helpful oneTricky is the helpful oneTricky is the helpful oneTricky is the helpful oneTricky is the helpful oneTricky is the helpful oneTricky is the helpful one
Re: PHP within HTML pages

Quote:
Originally Posted by Richard M
Actually all you need to do is put this in a .htaccess file and upload it to the root of your public webspace:

AddType application/x-httpd-php .html .htm
Worked a treat - Excellent one m8
Tricky is offline   Reply With Quote
Reply


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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 03:38.


Server: lithium.zmnt.uk
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
All Posts and Content are © Cable Forum