The php, asp, html conundrum

This is a discussion on "The php, asp, html conundrum" within the PHP Forum section. This forum, and the thread "The php, asp, html conundrum are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > PHP Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Feb 27th, 2006, 00:23
Junior Member
Join Date: Jan 2006
Posts: 46
Thanks: 0
Thanked 0 Times in 0 Posts
Question The php, asp, html conundrum

As I understand things, it goes as follows:

1. Web pages can be written in the usual html (or varaiations of, i.e. xtml), or in asp, or in php; all of which are scripting languages.

2. However, the usual html is not siutable for being able to produce scripts that will process things like form-data (in a html form-page), hence the need for php or asp scripts (usually held on the hosts server) and a reference code/tag on the html form page. Correct me if I'm wrong here...

Seeing as asp or php can be used for both creating/editing web pages and for writing processing-scripts (which presumably can process form-data in asp/php pages, as well as html one's), why are popular web editors still oriented towards html? Why do we still have html at all..?
Reply With Quote

  #2 (permalink)  
Old Feb 27th, 2006, 01:04
Reputable Member
Join Date: Sep 2005
Location: Canada, BC
Age: 24
Posts: 239
Thanks: 0
Thanked 0 Times in 0 Posts
Re: The php, asp, html conundrum

Nope, you have it wrong.
HTML is not a scripting language, its a markup language. Which means its used to "decorate" text effect layout etc.

PHP and ASP are serverside scripting languages, that process the page before it is sent to the browser/client. Normaly their output is an html page that can be displayed by a web browser, but they can also produce plain text, emails, images, flash, etc, or nothing at all.
Reply With Quote
  #3 (permalink)  
Old Mar 1st, 2006, 00:49
Junior Member
Join Date: Jan 2006
Posts: 46
Thanks: 0
Thanked 0 Times in 0 Posts
Re: The php, asp, html conundrum

Right - many thanks for that. I see where I was going wrong.
I know, at risk of a contradiction here, that 'ML' stands for Markup Language, only I heard somewhere that you could embed PHP code into a HTML document which is what confused me a bit - don't know if this is possible?

Anyway - so scripting languages like ASP/PHP usually process html pages before they are sent to the browser, then?
I'm still confused a bit here - wouldn't a server side script generally only be required for processing form data in which case the page would be processed after it has been sent to the browser? That is, a visitor submits a html form page that calls a processing script as specified in the form action (?). No contradiction here, but...
Reply With Quote
  #4 (permalink)  
Old Mar 1st, 2006, 01:25
Most Reputable Member
Join Date: Aug 2005
Location: North Wales, United Kingdom
Age: 21
Posts: 1,093
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to sypher
Re: The php, asp, html conundrum

Quote:
I heard somewhere that you could embed PHP code into a HTML document which is what confused me a bit - don't know if this is possible?
Yes with the <?php and ?> tags you can embed php into html.

They dont process the html pages they just process/parse the server side parts of the pages where html or asp applies. The browser process's the html part.
user > server > browser > user

Hope you get the idea.
Reply With Quote
  #5 (permalink)  
Old Mar 2nd, 2006, 10:52
Junior Member
Join Date: Jan 2006
Posts: 46
Thanks: 0
Thanked 0 Times in 0 Posts
Re: The php, asp, html conundrum

Many thanks...

I understand, in a way. But I also don't understand.
In the form's action-field (I use Dreamweaver) would I not specify the script (for my purposes, a script that will process form-data) to be called?
So, going by your answer which is clearing up a lot of things, does it matter whether the PHP script is embedded in the html form-page (also on the server in the first place), or if it resides as a standalone script on the server (php enabled); that is, not embedded?
In which case, why are both options adopted? Also, if the PHP script is embedded in the html form-page, do I still have to specify this/the script in the form's action field?

regards..

Last edited by a.jenery; Mar 2nd, 2006 at 10:59.
Reply With Quote
  #6 (permalink)  
Old Mar 2nd, 2006, 15:42
Most Reputable Member
Join Date: Aug 2005
Location: North Wales, United Kingdom
Age: 21
Posts: 1,093
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to sypher
Re: The php, asp, html conundrum

Beginners usually seperate their php scripts on seperate files.
For example:
Code: Select all
<form method="post" action"process-data.php">
Then they would make a php file names process-data which would handle all the form data.
But once you learn more about php you can embed all you need into the form itself.
Example:
Code: Select all
<form method="post" action="form.php">
This sends the data to itself and the php would process the data, meaning you wouldnt need 2 seperate files.

Hope you understand :P
Reply With Quote
  #7 (permalink)  
Old Mar 3rd, 2006, 12:15
Highly Reputable Member
Join Date: May 2005
Location: U.K
Age: 21
Posts: 739
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to benbramz
Re: The php, asp, html conundrum

sypher never makes sense...lol

let us know how u get on!
Reply With Quote
Reply

Tags
php, asp, html, conundrum

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
@include() conundrum CloudedVision PHP Forum 3 Feb 15th, 2008 03:38
Help with HTML cewgirl Web Page Design 6 Jun 7th, 2007 17:12
Help With My Html totally new Web Page Design 4 May 15th, 2007 12:57
Can I do this with html or anything else??? Petey_ Web Page Design 2 May 31st, 2006 21:04


All times are GMT. The time now is 22:09.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43