Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

Difference between php and html?


  • Please log in to reply
10 replies to this topic

#1 Delta16

Delta16

  • Members
  • 417 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Malta
  • Local time:02:34 PM

Posted 17 May 2009 - 01:58 AM

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
Delta

BC AdBot (Login to Remove)

 


#2 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:06:34 AM

Posted 17 May 2009 - 08:04 AM

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.

#3 Romeo29

Romeo29

    Learning To Bleep


  • Members
  • 3,194 posts
  • OFFLINE
  •  
  • Gender:Not Telling
  • Location:127.0.0.1
  • Local time:07:34 AM

Posted 17 May 2009 - 04:29 PM

Just to add what groovicus 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.

Edited by Romeo29, 17 May 2009 - 04:30 PM.


#4 harish kumar

harish kumar

  • Members
  • 18 posts
  • OFFLINE
  •  
  • Local time:06:04 PM

Posted 18 May 2009 - 01:16 AM

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.

#5 Delta16

Delta16
  • Topic Starter

  • Members
  • 417 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Malta
  • Local time:02:34 PM

Posted 19 May 2009 - 01:05 AM

Thanks all of you.

I've learned a lot from you

Thanks again.
Delta

#6 Yona

Yona

  • Members
  • 1 posts
  • OFFLINE
  •  
  • Local time:07:34 AM

Posted 08 November 2013 - 11:19 AM

Very clear and concise information. I learnt a lot also.



#7 Stolen

Stolen

  • Members
  • 669 posts
  • OFFLINE
  •  
  • Gender:Female
  • Local time:07:34 AM

Posted 09 November 2013 - 12:28 AM

me too!  :grinner: thank you guys! 



#8 ChelseaWoolf

ChelseaWoolf

  • Members
  • 58 posts
  • OFFLINE
  •  
  • Local time:04:34 AM

Posted 15 December 2013 - 12:01 AM

HTML: Hyer text markup language

PHP: Pre Hyper Processot : a server side script language

To execute php code you need php but html code can be executed in many way.



#9 Guest_philsmith_dot_com_*

Guest_philsmith_dot_com_*

  • Guests
  • OFFLINE
  •  

Posted 20 January 2014 - 12:55 PM

PHP originally meant Personal Home Page. Now it's a lot more, and we think of it as a pre-processor. PHP can generate a lot more than HTML. It can do things like upload files, generate images (with the GD library), send email, write to your server's filesystem and execute code, among other things. There's a reason WordPress and Joomla! are written in PHP.

 

PHP is also often the server-side code used with AJAX (it's the P in LAMP). It does NOT always return html. I use PHP to generate captcha images, and even the background which is always random. If you look at the source of that page, and then the style.css file, you'll see that the background is the url of a PHP file which generates the image.


Edited by groovicus, 20 January 2014 - 09:47 PM.


#10 janymariya

janymariya

  • Members
  • 1 posts
  • OFFLINE
  •  

Posted 18 July 2015 - 03:29 AM

  • HTML is a markup language while PHP is a scripting language
  • HTML is very easy and forgiving of mistakes while PHP isn’t
  • HTML codes are static and they are always the same every time they are opened while PHP files are dynamic and the output might not always be the same
  • The output of PHP is usually in HTML code which the browser can then interpret
 
 
____________________________________________________________
 


#11 YeahBleeping

YeahBleeping

  • Members
  • 1,258 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:06:04 PM

Posted 20 July 2015 - 01:07 PM

Annnnnnd here is my explaination. ( I just love giving my 2cents) :bounce:

 

PHP is indeed a server side scripting language.  So.. say for example you had a website where you are selling a <widget> and every time a buyer comes to your site you would like a new page generated to provide a special purchase discount code.  Lets say you have a certain number of discounts and when those discounts are used, no more discounts will be available.  You would need to use a php script to account for which codes have been used and then 'check off' that the code had been used and is no longer available.  You cannot do this with regular HTML code, so you would need to use a scripting language.  There are many scripting languages out there...

 

PHP

Perl

Coldfusion

 

The list goes on.  And yes there are client side scripts and server side scripts.

 

What I think you may want to focus on is CSS or custom style sheets.  An example of a style sheet in use would be say you had built a website that is grown to be 200 pages (of HTML code)  A page would be like clicking on forums up at the top of bleeping computer or clicking on Guides.  Guides being one page and Forums being page 2. (as an example)  Now say that Bleeping computer got bought out by someone and wanted to change the name.  With regular old HTML code you would have to change the name of the page at the top of EVERY page.  Using CSS you would only have to change 1 page and all the other pages would draw their information from it. 

 

You can get great tutorials of many web tools from webmonkey.com






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users