PHP Sites

  Ade_1 13:27 21 Apr 2006

Hi, i have never really looked into using PHP for my site as after looking at the coding i have found it a bit complicated. However after just thinking about having a go at it i opened dreamweaver and selected New PHP, only to see when i did that i saw i could select that i could do it in design view rather than coding. Shows how much i know, but is there any difference in doing it in design view than to coding? I didnt think there was. Also is PHP better to use than .html sites?

Apologies for the lengthy explaniation but im just trying to find out whats the better option.


  harristweed 12:24 24 Apr 2006

I think you need to understand what php is.

A page that has the .htm (.html) suffix is parsed immediately by the server. (jargon for displayed on the clients browser)

A page that has the php suffix (.php) is first sent to a php processor that ‘reads’ the php script and parses the htm code that it generates from the php code content in the page. The generated content is usually things that can’t be hard coded.
Like displaying information obtained from a database or displaying the IP address or the client making the request, doing calculations etc. Similar to javascript actions.
php is different from java script in that php generates the output on the server whilst java script generates the content on the clients computer after the page has been parsed.

So if you simply add the suffix .php to a static page all you will achieve is slowing things down because the page now goes via the php processor.

It doesn’t matter if you code in design view or code view, you won’t be able to see the php output because Dreamweaver is not a php processor and therefore can’t generate html from php code.

To see and test the output a php page generates you need to install a local server (apache for instance) and php on your own computer or use your web host.

This thread is now locked and can not be replied to.

Elsewhere on IDG sites

OnePlus 6 review: Hands-on

How to add texture to hand-drawn artworks

Best free iPad apps 2018

Comment créer un compte PayPal pour payer en ligne ?