HTML vs. PHP

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

Post Reply
gumphfy
Forum Newbie
Posts: 23
Joined: Fri Jan 06, 2006 10:18 am

HTML vs. PHP

Post by gumphfy »

I sure hope this is the right forum to post this in..but, oh well.

I'm about to write a report for my IT class, about the dynamacy of PHP as opposed to HTML. My work is really cut out for me...

But what I really want to ask you all, is what would be the most interesting aspects of PHP to include, aside from the adnimitrating point of view (like incorporate the site with a mysql DB)?

What I'm going to do as a project for the report, is creating two identically websites, one written entirely in HTML, and one in PHP (including the sql abilities).

What do you think I should include?

Things I want to include myself:
  • A switch function
    selection from a database
    insertion into a database
    The mandatory if/elseif statements
    inclusion
    Arries and variables
These are just some of my own apparent ideas, as I only started to work on the report today.
But I'm all up for new ideas, suggestions, comments and guidance.

Thanks in advance!
Charles256
DevNet Resident
Posts: 1375
Joined: Fri Sep 16, 2005 9:06 pm

Post by Charles256 »

do you mean how dynamic html is compared to php ? if so..is that really even a battle? one isn't dynamic, the other is...game over? :-D
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

PHP is a fully-pledged programming language in it's current state (some may argue not). HTML is just markup. There's no logic in HTML and thus you can't do anything dynamic with it by itself... it's static.

If we get into JavaScript however, well, now we can add some dynamic content to our web pages... this extends on the HTML much like PHP does... if we're talking about Javascript in HTML pages, well, we cn then speak of XMLHttp and the interface between JavaScript and PHP when working with AJAX :)

Not sure talking about switch statements and if/else (these are called control structures) will really be a big selling point since these exist in all (modern) programming languages. Inclusion and interfacing with MySQL is certainly something that makes PHP worth using in websites though.

If you're using PHP you're still using HTML (probably) since that's the output you'll get it to produce... so basically you've added a lot more to the possibilities of what your web pages can do! :D
gumphfy
Forum Newbie
Posts: 23
Joined: Fri Jan 06, 2006 10:18 am

Post by gumphfy »

No, you're right, it's not a fair battle, and I did that on purpose so it would be clear how superior PHP really is. I'm not about to discuss the possibilities in HTML with or without JS/AJAX, as I only want to use the HTML as a counterpart of how inefficient a website really can be, when administrating it.

I only want to use the PHP to illustrate the possibilities of web programing languages today, and in the future.
So I really want to bring out the best in PHP, while keeping it all very simple.
I want it all the be understandable by people to whom PHP is unknown turf.

Even though some may say that HTML and PHP are incomparable, I still want to use those two, and only those two (no asp, js, ajax, xml etc.)
It is solely to prove the strength of PHP.

That's why I wanted some input from you guys, of what might be the most interesting aspects of PHP to include.
d3ad1ysp0rk
Forum Donator
Posts: 1661
Joined: Mon Oct 20, 2003 8:31 pm
Location: Maine, USA

Post by d3ad1ysp0rk »

For a presenation idea, I'd show them the steps required to change say, the about page's body with both a control panel, and with straight html.

Control:
- Login
- Navigate to about page editor
- Change page info

Static HTML:
- Download FTP client
- Connect to server
- Download file
- Open file in editor
- Change line and save
- Upload file to server

Also, note to them how you were required to shift through all the markup and layout information just to edit the content. Explain to them how hard it would be for a user with no web experience (HTML) to edit the page.
Post Reply