uTalk

Official forum for Utopia Community

You are not logged in.

#1 2021-02-08 12:18:07

Ollester
Member
Registered: 2021-01-11
Posts: 64

Difference between php and html

first of all, I'm new to web development. I'm building a site from scratch with dream weaver and a friend told me, that html can be stolen and php not.

What is the difference between them?

AND

Does php needs something to be protected?

Thanks in advanced

Offline

#2 2021-02-08 13:15:13

HanBaoCinch
Member
Registered: 2021-01-11
Posts: 93

Re: Difference between php and html

HTML is a language used to describe to a browser how to display text and other objects in a browser window. It is not a programming language. HTML works on a client computer (the system on which the page is being viewed).

PHP is a scripting language, and can be used to create web pages written in HTML. PHP runs on the server (the system from which the page comes), and is a full-fledged programming language

>Does php needs something to be protected?

That question doesn't exactly make sense. Langauges do not need 'protection.' The manner in which they are used can sometimes cause problems for the system on which they run, but that will in no way hurt the language itself.

The HTML of any web page can be viewed by right-clicking in a web page; the HTML created by PHP can be viewed by right clicking in a web page. PHP does nothing to prevent your HTML from being viewed. Once the HTML is on my computer, there is nothing that you can do to protect it from being viewed by someone that wants to see it.

Offline

#3 2021-02-08 15:59:33

Drassen
Member
Registered: 2021-01-11
Posts: 71

Re: Difference between php and html

Just to add what was already said:

There are two types of scripting languages : client side scripting and server side scripting languages. Javascript, VBscript, etc are client side scripting languages. If you write code in these, the code is downloaded on client's computer and executed there. PHP, ASP etc are server side scripting languages, they execute on the server and only the output is downloaded on the client's computer.

This way a user visiting a website made in PHP or ASP cannot view the code but only the output generated by the scripting code.

Some people may use your PHP code by inspecting its behaviour.
For example, if you have a code that generates a N digit password, a person can use it using this link : http://www.blah.com/generate.php?digits=5 and display the output in his/her own website.
It all depends on studying the behaviour of your code.
To protect PHP code so no body else can use it, you can contact your web site host to block such attempts.

Offline

#4 2021-02-08 16:15:03

lolapolooza
Member
Registered: 2021-01-11
Posts: 66

Re: Difference between php and html

PHP files are just like HTML files, but they can include both HTML and PHP code. The PHP code is parsed (or executed) by the Web server when the page is accessed and the resulting output is written as HTML within the Web page. When a user accesses a PHP page, his Web browser only gets sent the HTML code, since the Web server has processed the PHP code in the background. Most PHP pages are processed so quickly that it does not noticeably slow down the loading of the Web page.

The .php extension is important, since it tells the Web server that the page may include PHP code. Therefore, it must be run through the server's PHP engine before being sent to a client's Web browser. This allows dynamic content to be generated each time the Web page is loaded, based on the variables included in the PHP code. For example, PHP pages may load objects such as the current date and time, data from form fields submitted by a user, or information from a database. Still, once the page reaches the user's Web browser, everything is formatted as HTML.

Offline

Board footer

Powered by FluxBB