Cable Forum

Cable Forum (https://www.cableforum.uk/board/index.php)
-   Internet Discussion (https://www.cableforum.uk/board/forumdisplay.php?f=25)
-   -   Confused..... .php / .html (https://www.cableforum.uk/board/showthread.php?t=24561)

Raistlin 22-02-2005 21:18

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.

Paul 22-02-2005 21:20

Re: Confused..... .php / .html
 
PHP is a programming (script) language.

Richard M 22-02-2005 21:21

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

Raistlin 22-02-2005 21:26

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.

Plonking 22-02-2005 21:27

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...

:)

Paul 22-02-2005 21:27

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 ?

Plonking 22-02-2005 21:28

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!

Raistlin 22-02-2005 21:31

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?

Richard M 22-02-2005 21:33

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

Plonking 22-02-2005 21:33

Re: Confused..... .php / .html
 
indeed, you have, as they say, hit the proverbial nail on the head. :)

Raistlin 22-02-2005 21:34

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.

Bifta 22-02-2005 21:51

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.

punky 22-02-2005 22:10

Re: Confused..... .php / .html
 
One thing I should add is you can spot PHP code in two ways:

1

PHP Code:


<?php

....

?>

2.

PHP Code:


<?

...

?>


greencreeper 23-02-2005 01:21

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.

Richard M 23-02-2005 01:40

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 ;)


All times are GMT +1. The time now is 10:25.

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