HTML Coding
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Go Back   SEO Chat ForumsOtherHTML Coding

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 SEO Chat Forums Sponsor:
  #1  
Old January 24th, 2006, 08:44 PM
banedon banedon is offline
Registered User
SEO Chat Newbie (0 - 499 posts)
 
Join Date: Jan 2006
Posts: 2 banedon User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 32 m 8 sec
Reputation Power: 0
Php code in html

is it possible? i know next to nothing about php, i only started dabbling with web publishing three weeks ago.

i read somewhere about something called a cPanel having to do with this. :confused: thanks alot!

Reply With Quote
  #2  
Old January 24th, 2006, 09:28 PM
BidRank's Avatar
BidRank BidRank is offline
SEO Apprentice
SEO Chat Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 208 BidRank User rank is Corporal (100 - 500 Reputation Level)BidRank User rank is Corporal (100 - 500 Reputation Level)BidRank User rank is Corporal (100 - 500 Reputation Level)BidRank User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 5 Days 10 h 34 m 22 sec
Reputation Power: 7
It was mentioned in this thread as being possible via an htaccess edit.

http://forums.seochat.com/google-optimization-7/html-to-php-67018.html

I have not tried it yet though. It causes the server to parse every HTML page for PHP which is a performance hit.
__________________
BidRank
Automated Pay-Per-Click Bid Management Software for Yahoo! SM (Overture), Google, MIVA and other PPC search engines.

Reply With Quote
  #3  
Old January 24th, 2006, 09:55 PM
ClickyB's Avatar
ClickyB ClickyB is offline
Cool bra. Go with Christ!
Click here for more information. Click here for more information
 
Join Date: Mar 2004
Location: Gloucester (South West UK).
Posts: 5,029 ClickyB User rank is Captain (20000 - 30000 Reputation Level)ClickyB User rank is Captain (20000 - 30000 Reputation Level)ClickyB User rank is Captain (20000 - 30000 Reputation Level)ClickyB User rank is Captain (20000 - 30000 Reputation Level)ClickyB User rank is Captain (20000 - 30000 Reputation Level)ClickyB User rank is Captain (20000 - 30000 Reputation Level)ClickyB User rank is Captain (20000 - 30000 Reputation Level)ClickyB User rank is Captain (20000 - 30000 Reputation Level)ClickyB User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 3 Months 4 Weeks 11 h 59 m 36 sec
Reputation Power: 213
I use an htaccess line (rather like an ssi directive) which allows me to parse my html pages with php...

addtype application/x-httpd-php .html

It works a treat for me (running on apache/unix)
__________________
ClickyB
"The quality of the visitor is more important than the volume".. Egol 22nd Feb 2008
New to SEO / SeoChat? Start : Here
Forum Rules & Posting Guidelines
Canonicalisation Solutions

Reply With Quote
  #4  
Old January 24th, 2006, 10:38 PM
banedon banedon is offline
Registered User
SEO Chat Newbie (0 - 499 posts)
 
Join Date: Jan 2006
Posts: 2 banedon User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 32 m 8 sec
Reputation Power: 0
Quote:
You can run PHP code in .html files. If you add:

AddType application/x-httpd-php .php .html

to your .htaccess file, all pages with a .html extension will also be parsed by PHP. So you can keep your current .html pages, and add PHP code to them.
if i wanted to have only one php page? will that cause a noticaalbe decrease in performance?

Reply With Quote
  #5  
Old January 25th, 2006, 12:39 AM
Catacaustic Catacaustic is offline
Contributing User
SEO Chat Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 130 Catacaustic User rank is Private First Class (20 - 50 Reputation Level)Catacaustic User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 3 Days 17 h 1 m 6 sec
Reputation Power: 6
Quote:
Originally Posted by banedon
if i wanted to have only one php page? will that cause a noticaalbe decrease in performance?
There will be a difference in performace if you don't use PHP on all of the HTML pages, but parse all HTML pages as PHP.

This happens because straight HTML pages are just retrived from the server and sent out, no messing around and no extra processing. PHP pages are retrived, sent to the PHP parser, sent back and then sent out. When you set all HTML pages to be served as PHP , then they will all be sent to the PHP aprser and will all take extra time to serve.

Having said that, PHP is still a pretty darned fast way of getting dynamic content up on the web, so any speed issues with pages that don't have complicated code or processes on them won't be noticed by most users because it's more likely that their internet connection will be slower then the rate that the server is pushing out the pages anyway. Any performance hits will come if you start getting a whole lot of hits and your server can't cope with the traffic. This is always possible, but on a decent web server, it'll take a lot of visitors for this to happen.

Reply With Quote
  #6  
Old January 25th, 2006, 07:29 AM
MABDesign's Avatar
MABDesign MABDesign is offline
SEO Ninja
SEO Chat Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Location: Richmond/Raleigh
Posts: 297 MABDesign User rank is Corporal (100 - 500 Reputation Level)MABDesign User rank is Corporal (100 - 500 Reputation Level)MABDesign User rank is Corporal (100 - 500 Reputation Level)MABDesign User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 3 Days 3 h 44 m 13 sec
Reputation Power: 7
Conversely, you can parse html in a .php page with no problems at all. If you only have a single php-based page, why not just leave it with the natural extension?

Reply With Quote
  #7  
Old February 11th, 2006, 08:08 AM
NavyCS's Avatar
NavyCS NavyCS is offline
Contributing User
SEO Chat Novice (500 - 999 posts)
 
Join Date: Jan 2006
Location: Bartlett, TN
Posts: 797 NavyCS User rank is Sergeant (500 - 2000 Reputation Level)NavyCS User rank is Sergeant (500 - 2000 Reputation Level)NavyCS User rank is Sergeant (500 - 2000 Reputation Level)NavyCS User rank is Sergeant (500 - 2000 Reputation Level)NavyCS User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 3 Weeks 2 Days 22 h 9 m 36 sec
Reputation Power: 14
I have included php in an html page - it is working great and accomplishing exactly what I want. How do I acheive W3C markup validation when a page is running 2 codes?

www.navycs.com

Reply With Quote
  #8  
Old February 11th, 2006, 11:02 AM
ClickyB's Avatar
ClickyB ClickyB is offline
Cool bra. Go with Christ!
Click here for more information. Click here for more information
 
Join Date: Mar 2004
Location: Gloucester (South West UK).
Posts: 5,029 ClickyB User rank is Captain (20000 - 30000 Reputation Level)ClickyB User rank is Captain (20000 - 30000 Reputation Level)ClickyB User rank is Captain (20000 - 30000 Reputation Level)ClickyB User rank is Captain (20000 - 30000 Reputation Level)ClickyB User rank is Captain (20000 - 30000 Reputation Level)ClickyB User rank is Captain (20000 - 30000 Reputation Level)ClickyB User rank is Captain (20000 - 30000 Reputation Level)ClickyB User rank is Captain (20000 - 30000 Reputation Level)ClickyB User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 3 Months 4 Weeks 11 h 59 m 36 sec
Reputation Power: 213
Quote:
Originally Posted by NavyCS
I have included php in an html page - it is working great and accomplishing exactly what I want. How do I acheive W3C markup validation when a page is running 2 codes?

www.navycs.com
I don't know much about this; I do have several hundred html pages parsed with php code but when I view their source online, I see only html code... (which validates fine)!

I assume this is the result of parsing although it could just be the "types of function" I'm using the php for!

You might want to check the S/C of your page once it's online, I suspect it's the same!

If somebody knows what the hell I'm talking about, I'd be interested if you would explain why!

Reply With Quote
  #9  
Old February 14th, 2006, 12:27 AM
sparrowhawk's Avatar
sparrowhawk sparrowhawk is offline
parenthetical over-user
SEO Chat Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: (US) New Hampshire
Posts: 406 sparrowhawk User rank is Corporal (100 - 500 Reputation Level)sparrowhawk User rank is Corporal (100 - 500 Reputation Level)sparrowhawk User rank is Corporal (100 - 500 Reputation Level)sparrowhawk User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 15 h 32 m 6 sec
Reputation Power: 9
I'll take a stab at it

Quote:
Originally Posted by NavyCS
I have included php in an html page - it is working great and accomplishing exactly what I want. How do I acheive W3C markup validation when a page is running 2 codes?

www.navycs.com


If I understand you correctly you are developing a file that contains a combination of traditional html markup with some php included as well and you are wondering how to validate the code vs. W3C standards.

What you want to do is validate the output code. The easiest way to do this is to view the source of your webpage. PHP is processed server side and only the processed output is delivered to a browser. In this case some html combined with more html generated by your PHP scripts. When you view the source you will only see the html output.

Once you are viewing the source you can copy and paste the markup into your choice of W3C validation tools. Here is the official one:
http://validator.w3.org/

Viola! Now you can see how your webpage validates vs. W3C standards. You can also use tools that will retrieve your webpage and validate it as well.

I hope I answered the same question you asked. I'm not sure that I did.

---
BTW - I highly recommend Zend Studio for a PHP IDE. If you are concerned with clean output code it is really the best.

It allows you to preview your output code as you are developing (which is awesome!).
http://www.zend.com/products/zend_studio

It's only worth the price if you are planning on spending some time in the PHP trenches, but if you are check it out. It also runs great on Linux if you that's your OS of choice.

Reply With Quote
  #10  
Old February 22nd, 2006, 12:04 PM
topsites topsites is offline
Contributing User
SEO Chat Newbie (0 - 499 posts)
 
Join Date: Dec 2005
Posts: 58 topsites User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 18 h 19 sec
Reputation Power: 5
Quote:
Originally Posted by banedon
if i wanted to have only one php page? will that cause a noticaalbe decrease in performance?


Depends, so long you use your php page as php and leave your html as html, the performance issue is present but very minor.

You can alternatively use html in your php, the more commonly accepted method.

Reply With Quote
  #11  
Old March 23rd, 2006, 01:33 AM
mickh's Avatar
mickh mickh is offline
Contributing User
SEO Chat Newbie (0 - 499 posts)
 
Join Date: Sep 2005
Posts: 143 mickh User rank is Private First Class (20 - 50 Reputation Level)mickh User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 1 Day 14 h 36 m 23 sec
Reputation Power: 5
When PHP runs as an Apache module (the norm on Linux web servers) and not in CGI mode, the performance hit is negligible in most cases. You'd really need to be pushing the limits before it became a real issue.

On a properly configured server, the PHP code never leaves the server. All that is output is HTML and that is all the W3C validator sees. PHP writes the HTML dynamically then sends it off, end users including W3C never see anything but HTML.
Comments on this post
ClickyB agrees: Sweet... Thanks for the explanation

Reply With Quote
Reply

Viewing: SEO Chat ForumsOtherHTML Coding > Php code in html


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




 Free IT White Papers!
 
Create the Optimal Architecture for your Critical Applications
Warburton's the largest independently owned bakery in the UK faced a number of difficult challenges in providing the most robust yet efficient IT infrastructure for their organization's success. IBM's services combined with their xSeries servers created the perfect platform for their SAP environment with sufficient flexibility, and did so in very time effective fashion.

Request Your Free Technology Downloads!
 
Five Best Practices for Deploying a Successful Service-Oriented Architecture
This white paper describes the benefits you can expect with SOA, and how IBM can help take your business there.

Request Your Free Technology Downloads!
 
Gartner Magic Quadrant for Application Delivery Controllers
Gartner summarizes its view on Application Delivery Controllers, evaluates strengths and weaknesses of solutions, and provides Magic Quadrant reporting for a quick comparison across all vendors. Learn from Gartner how you can benefit from an all-in-one device like Citrix NetScaler that delivers the highest levels of availability, performance and security.

Request Your Free Technology Downloads!
 
Knowledge is Power
What you don't know can hurt you, and is likely costing you money and increasing your security risks during an era of scarce resources. This white paper proposes six key strategies that enterprise security managers can use to improve their network defense posture.

Request Your Free Technology Downloads!
 
Rationalizing the Multi-Tool Environment
The rationalized multi-tool approach is flexible, scalable and cost effective. It provides the necessary input to the IT service management business processes. It preserves prior investments in monitoring tools, empowers technologists to select the best tools with which to do their jobs, and enhances effective response to incidents.

Request Your Free Technology Downloads!
 

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




© 2003-2010 by Developer Shed. All rights reserved. DS Cluster 11 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek