Confused..... .php / .html
22-02-2005, 21:18
|
#1
|
|
Inactive
Join Date: Feb 2004
Location: There's no place like 127.0.0.1
Services: Depends on the person and the price they're offering
Posts: 12,384
|
Confused..... .php / .html
What is PHP and why would I want to use it?
The reason I ask is that the holding page for my new website has a .php extension but appears to have been written in HTML (or at least there is HTML in the source code when viewed in Firefox).
Anybody able to clear this up for me / tell me when I should be using one instead of the other / why?
Thanks.
|
|
|
22-02-2005, 21:20
|
#2
|
|
Dr Pepper Addict
Cable Forum Admin
Join Date: Oct 2003
Location: Nottingham
Age: 63
Services: IDNet FTTP (1000M), Sky Q TV, Sky Mobile, Flextel SIP
Posts: 30,319
|
Re: Confused..... .php / .html
PHP is a programming (script) language.
__________________
Baby, I was born this way.
|
|
|
22-02-2005, 21:21
|
#3
|
|
Inactive
Join Date: Jun 2003
Location: Los Angeles, CA
Age: 46
Posts: 6,343
|
Re: Confused..... .php / .html
Quote:
|
PHP (recursive acronym for "PHP: Hypertext Preprocessor") is a widely-used Open Source general-purpose scripting language that is especially suited for Web development and can be embedded into HTML.
|
More here:
http://uk.php.net/manual/en/introduction.php
|
|
|
22-02-2005, 21:26
|
#4
|
|
Inactive
Join Date: Feb 2004
Location: There's no place like 127.0.0.1
Services: Depends on the person and the price they're offering
Posts: 12,384
|
Re: Confused..... .php / .html
Ok, thanks for that guys.
I can't see any PHP in the source code though, is there a chance that it's somewhere else?
The only thing I can see is a bit of JavaScript that doesn't actually seem to do anything.
|
|
|
22-02-2005, 21:27
|
#5
|
|
Inactive
Join Date: Feb 2004
Location: Bournemouth
Age: 42
Services: BT Somethingorother
Posts: 470
|
Re: Confused..... .php / .html
Quote:
|
Originally Posted by Raistlin
What is PHP and why would I want to use it?
Anybody able to clear this up for me / tell me when I should be using one instead of the other / why?
Thanks.
|
It lets you do funky stuff on websites, for example, this forum! It's quite easy to use as well, and there are plenty of tutorials and books out there, so if you're interested in what it can do, those might also help you get a good idea...
|
|
|
22-02-2005, 21:27
|
#6
|
|
Dr Pepper Addict
Cable Forum Admin
Join Date: Oct 2003
Location: Nottingham
Age: 63
Services: IDNet FTTP (1000M), Sky Q TV, Sky Mobile, Flextel SIP
Posts: 30,319
|
Re: Confused..... .php / .html
Quote:
|
Originally Posted by Raistlin
I can't see any PHP in the source code though, is there a chance that it's somewhere else?
The only thing I can see is a bit of JavaScript that doesn't actually seem to do anything.
|
source code of what ?
__________________
Baby, I was born this way.
|
|
|
22-02-2005, 21:28
|
#7
|
|
Inactive
Join Date: Feb 2004
Location: Bournemouth
Age: 42
Services: BT Somethingorother
Posts: 470
|
Re: Confused..... .php / .html
Quote:
|
Originally Posted by Raistlin
Ok, thanks for that guys.
I can't see any PHP in the source code though, is there a chance that it's somewhere else?
The only thing I can see is a bit of JavaScript that doesn't actually seem to do anything.
|
You don't get to see the php code itself, that is hidden away on the server, which works everything out and then sends the html to you when you view it.. if that makes sense, lol!
|
|
|
22-02-2005, 21:31
|
#8
|
|
Inactive
Join Date: Feb 2004
Location: There's no place like 127.0.0.1
Services: Depends on the person and the price they're offering
Posts: 12,384
|
Re: Confused..... .php / .html
Quote:
|
Originally Posted by Plonking
You don't get to see the php code itself, that is hidden away on the server, which works everything out and then sends the html to you when you view it.. if that makes sense, lol!
|
There's nothing in the HTML for the page that looks anything like a call to any other resource though. Is it possible that the HTML itself is being generated by the .php page and I am seeing the result of that dynamic generation rather than actually seeing the coding of the .php page?
|
|
|
22-02-2005, 21:33
|
#9
|
|
Inactive
Join Date: Jun 2003
Location: Los Angeles, CA
Age: 46
Posts: 6,343
|
Re: Confused..... .php / .html
Quote:
|
Originally Posted by Raistlin
There's nothing in the HTML for the page that looks anything like a call to any other resource though. Is it possible that the HTML itself is being generated by the .php page and I am seeing the result of that dynamic generation rather than actually seeing the coding of the .php page?
|
That's what server-side code does. :o
|
|
|
22-02-2005, 21:33
|
#10
|
|
Inactive
Join Date: Feb 2004
Location: Bournemouth
Age: 42
Services: BT Somethingorother
Posts: 470
|
Re: Confused..... .php / .html
indeed, you have, as they say, hit the proverbial nail on the head.
|
|
|
22-02-2005, 21:34
|
#11
|
|
Inactive
Join Date: Feb 2004
Location: There's no place like 127.0.0.1
Services: Depends on the person and the price they're offering
Posts: 12,384
|
Re: Confused..... .php / .html
Cool, downloaded it and opened using notepad and there's a whole load of code that I couldn't see before. Thanks for your help guys.
|
|
|
22-02-2005, 21:51
|
#12
|
|
Inactive
Join Date: Jul 2003
Location: Eglinton, Co. Derry
Posts: 7,640
|
Re: Confused..... .php / .html
Quote:
|
Originally Posted by Raistlin
Cool, downloaded it and opened using notepad and there's a whole load of code that I couldn't see before. Thanks for your help guys.
|
You can (if you wanted) just save a normal html document with no server side code in with a .php suffix.
|
|
|
22-02-2005, 22:10
|
#13
|
|
Inactive
Join Date: Jun 2003
Age: 44
Posts: 14,750
|
Re: Confused..... .php / .html
One thing I should add is you can spot PHP code in two ways:
1
2.
|
|
|
23-02-2005, 01:21
|
#14
|
|
Inactive
Join Date: Nov 2003
Location: Leeds - the dog house
Age: 48
Services: Email me for a current price list
Posts: 8,270
|
Re: Confused..... .php / .html
There's a nifty bit of Apache (web server), which is bolted on, that goes "Cooooo - someone requesting a PHP page" and nips in, grabs the page, has a read, converts all the programming code to HTML, and hands the HTML to Apache to give to the client. The nipping in bit is where much tweaking goes on to improve the speed of the nipping. It's caused a few problems with this site, I believe? The bolted on bit is called a module, and the conversion process from PHP to HTML code is interpretation - which makes PHP an interpreted language.
The page does not have to have a .php extension - could have .moo Just depends on how Apache is configured.
|
|
|
23-02-2005, 01:40
|
#15
|
|
Inactive
Join Date: Jun 2003
Location: Los Angeles, CA
Age: 46
Posts: 6,343
|
Re: Confused..... .php / .html
Quote:
|
Originally Posted by greencreeper
The page does not have to have a .php extension - could have .moo Just depends on how Apache is configured.
|
Or .html or even dot nothing
|
|
|
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
|
|
|
All times are GMT +1. The time now is 13:34.
|