Author Topic: WTH is .php  (Read 408 times)

Offline SkyWolf

  • Nickel Member
  • ***
  • Posts: 599
WTH is .php
« on: October 12, 2005, 06:59:54 AM »
And what do I need to display pages written in it? Seems to be Linux based or something...... but if web pages are written in it then why is it such a chore to display them?

Any info?

Offline StarOfAfrica2

  • Platinum Member
  • ******
  • Posts: 5162
      • http://www.vf-17.org
WTH is .php
« Reply #1 on: October 12, 2005, 12:48:16 PM »
http://www.php.net/

Web pages arent necessarily written in it, its embedded in HTML.

Offline Skuzzy

  • Support Member
  • Administrator
  • *****
  • Posts: 31462
      • HiTech Creations Home Page
WTH is .php
« Reply #2 on: October 12, 2005, 01:38:10 PM »
All the HTML code in a PHP page is just regular HTML.  The PHP portion is wrapped in special delimiters ( ends) so PHP can excute it.  Anything outside of the delimiters is just sent 'as is'.

For example, if the following was included between the tags of a PHP file (index.php):

Say what!



and

echo "

Say what!

"
?>

They would produce the same line twice on in the browser.  Only difference being, the first line was sent 'as is' by PHP, and the second line was parsed and handled by PHP before beeing sent.

Of course, you would not really want to do the second line, as it is written, but if you had some variable you needed displayed, it is quite easy in PHP to do so.

By the way, I am assuming a UNIX based server with Apache on it.
Roy "Skuzzy" Neese
support@hitechcreations.com

Offline 2bighorn

  • Gold Member
  • *****
  • Posts: 2829
Re: WTH is .php
« Reply #3 on: October 12, 2005, 03:12:43 PM »
Quote
Originally posted by SkyWolf
Seems to be Linux based or something......
PHP runs on almost all platforms, Unix, Linux, Windows... It is also not limited to Apache, it runs OK with Zeus, even with IIS.
Quote
Originally posted by SkyWolf
but if web pages are written in it then why is it such a chore to display them?
If you're just doing static pages, you probably won't need PHP. HTML and maybe some Java Script will do the job.

If you look at Skuzzy's post you'll see you can do it different ways. If you are beginner (or you need no more than a function or two), just write your page in HTML and insert the PHP into places where you need it.

If you're working on some advanced dynamic sites, then, sometimes, is more efficient to echo the HTML.

It really depends what you want to achieve with your page/site.

Offline SkyWolf

  • Nickel Member
  • ***
  • Posts: 599
Re: Re: WTH is .php
« Reply #4 on: October 13, 2005, 07:34:22 AM »
Quote
Originally posted by 2bighorn
PHP runs on almost all platforms, Unix, Linux, Windows... It is also not limited to Apache, it runs OK with Zeus, even with IIS.  If you're just doing static pages, you probably won't need PHP. HTML and maybe some Java Script will do the job.

If you look at Skuzzy's post you'll see you can do it different ways. If you are beginner (or you need no more than a function or two), just write your page in HTML and insert the PHP into places where you need it.

If you're working on some advanced dynamic sites, then, sometimes, is more efficient to echo the HTML.

It really depends what you want to achieve with your page/site.


OK.... I'm not trying to create with it... I was trying to read a page with a .php extention. Musta been broke. Thanks for the info!

Offline Schutt

  • Silver Member
  • ****
  • Posts: 1138
WTH is .php
« Reply #5 on: October 13, 2005, 12:15:49 PM »
One more try on an explanation.

PHP is "perl hypertext page"

A webpage that is a "php" page is not stored on the server in the form it is displayed to the client. Basically the page is a file that gets processed by the server (by a perl type interpreter but thats not important) and the output of the processing is send to the client to look at it. In the file there can either be "plain" html, meaning that the written text is transferd without change to the client, or "code" which is executed by the server and the output of the code will be transmitted to the client.

This way the page can provide dynamic content, like information from a database or other stuff that is created on the web server. But an dynamic page means it relys on other stuff, like a database, other files, aditional info on the html request etc. and looks diffrent each time its displayed.

To read a php page you need a php enabled webserver, which can also run locally (meaning you could start one on your own comp without the need of internet) and all the libraries, files, databases,functions that are used in the php page.

Pretty similar to php is jsp, java server pages. There is also a microsoft version of server side html pages but i forgot the name.

Offline BBQ_Bob

  • Silver Member
  • ****
  • Posts: 892
      • http://uknightedstates.net
WTH is .php
« Reply #6 on: October 16, 2005, 01:16:42 AM »
Would the Microsoft version be "Microsoft Active Server Pages" ?
UKNIGHTED Propaganda Minister
"There are no Hells Angels in the MA, never"

"they are nowhere near the airport ..they are lost in the desert...they can not read a compass...they are retarded."

For a good time ~~ www.uknightedstates.net