SitePoint Sponsor

User Tag List

Results 1 to 8 of 8

Thread: What is PHP?

  1. #1
    SitePoint Member
    Join Date
    Jan 2001
    Posts
    21
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I cant figure out what it is. What makes .php different from .html and what are the benefits and disadvantages of using that extension? Basically, what the heck does php do?

  2. #2
    Idea Developer
    Join Date
    Sep 2000
    Location
    Bethlehem, PA
    Posts
    521
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    personal home page tools.

  3. #3
    SitePoint Zealot
    Join Date
    Apr 2001
    Location
    Toronto, Ontario, Canada, Earth
    Posts
    138
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    php is a servers-side scripting language that allows commands to be directly embedded into an html document. one major advantage it has over html is that it can be used to create dynamically generated pages.

  4. #4
    Serial Publisher silver trophy aspen's Avatar
    Join Date
    Aug 1999
    Location
    East Lansing, MI USA
    Posts
    12,937
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    this article:

    http://www.webmasterbase.com/article.php?aid=295

    may make things a little clearer to you.
    Chris Beasley - I publish content and ecommerce sites.
    Featured Article: Free Comprehensive SEO Guide
    My Guide to Building a Successful Website
    My Blog|My Webmaster Forums

  5. #5
    SitePoint Wizard
    Join Date
    Mar 2001
    Posts
    3,537
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    Wow, that is strange. When I slapped a .php extension on my somewhat ordinary .html file, the whole world changed. My website started doing all kinds of neat dynamic tricks, like waking me up in the middle of the night with loud music and asking me if I wanted to party; and it continually wanted to play all kinds of cool 3D video games with me, and finally it repainted the whole site with graphics that looked like they were professionally designed with Adobe Photoshop.

    There must be a setting you didn't change.

  6. #6
    midnight coder
    Join Date
    Dec 2000
    Location
    The flat edge of the world
    Posts
    838
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by 7stud
    Hi,

    Wow, that is strange. When I slapped a .php extension on my somewhat ordinary .html file, the whole world changed. My website started doing all kinds of neat dynamic tricks, like waking me up in the middle of the night with loud music and asking me if I wanted to party; and it continually wanted to play all kinds of cool 3D video games with me, and finally it repainted the whole site with graphics that looked like they were professionally designed with Adobe Photoshop.

    There must be a setting you didn't change.
    Here it is folks, the undocumented setting, add this line to php.ini:

    php.smart_mode=1

  7. #7
    SitePoint Wizard
    Join Date
    Mar 2001
    Posts
    3,537
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    For that matter you should try C++. It has a reputation for being very, very fast, so I changed my .html files to a .cpp extension, and boy you aren't kidding: my site sped up like a rocket ship. Now, I can crunch numbers at the speed of light, and my site can load 100 images on a page in a nano second. Caching? Who cares! C++ is so fast you can reload everything, all the time and not notice any difference. In fact the pages load so fast, you don't even have to worry about persistence. The new page can grab the values off the old page before it disappears.

    I can't understand why everyone thinks C++ is so difficult.

  8. #8
    SitePoint Columnist Skunk's Avatar
    Join Date
    Jan 2001
    Location
    Lawrence, Kansas
    Posts
    2,066
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP is a server side scripting language. What this means is that it is a way of "programming" web pages - the web server itself can then go through the PHP script and evaluate it, generating a standard page of HTML which is then delivered to the user's browser.

    Very simple example: Say you want to display today's date at the top of your page. Using PHP you could add the following lines of code where you want the date to be displayed:
    PHP Code:
    <?php
    echo "Today's date is " date("F j, Y");
    ?>
    When you viewed the page in a browser (having served it from a web server that has PHP installed) you would see:
    Code:
    Today's date is April 29, 2001
    If you viewed the source code of the page using your browser's "view source" option you would see the same text - the PHP code (everything between <?php and ?>) is run by the server and only the output of the code is sent as HTMl to the browser.

    PHP has a massive array of features, such as the ability to easily connect to and interact with a database. As a result PHP can be used for a HUGE array of things. These forums are written in PHP, as is the SitePoint website itself (the PHP scripts there allow members of the SitePoint staff to easily add new articles without having to create and upload HTML pages every time they want to add a new page to the site).

    If you want to learn more about PHP I've written a article with links to all of the resources I found most useful when learning it - you can find that here:

    www.wpwm.com/php.asp

    Hope that helps,

    Skunk


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •