PHP Sites

  Ade_1 13:27 21 Apr 06
Locked

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.

Thanks
Aidan

  harristweed 12:24 24 Apr 06

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.

How to get Windows 10 for free | How to install Windows 10: There is still a way to avoid paying…

1995-2015: How technology has changed the world in 20 years

Alex Chinneck’s giant ice cube Christmas tree at Kings Cross

Apple rumours & predictions 2017: The iPhone 8, new iPads, and everything else you should expect fr7…