Let me teach about PHP in easy steps. First of let me explain what is Programing Language.
“ A Programing language is artificial language used to express computer that can be performed with a machine, particularly Computer.”
- PHP is recursive acronym stands for Personal Home Page, it is now said to stand for PHP: Hypertext Preprocessor
- PHP Is used for developing 3 types of applications
- Command Line scripting
- Desktop (or) GUI
- Web Applications
- The main purpose of introducing PHP is to develop Web applications.
- PHP programs saved with an extension of .PHP
- Actually all the web applications runs in an request and respond mechanism (or) client server mechanism.
- The Programs which present in the client machine are sending requests to the server and getting response from server is called client side programs.
examples: Firefox, Chrome, Internet explorer
- All the PHP programs gets executed in server and will give a response back to the client (Browser) in pure HTM format.
- Every PHP program contains HTML Tags plain text and PHP scripts.
- A web server is an application running in the server machine.
- PHP programs can be Placed in most of web servers.
Example: IIS, Apache, NGINX
- PHP can run almost any Database.
- PHP is platform independent.
- At the time of PHP script execution in webserver the PHP script converts into “opcode” (Operational code) and send it to interpreter.
- The PHP interpreter is ZEND it is also called PHP parser.
- This Interpreter converts the “opcode” to HTML.
- For more details about History Click here for Wikipedia.
- On Next Class we will discuss about Instalation of PHP.
Cascading Style Sheets (CSS) is a style sheet language
and it was used for presentations look and formatting of a document written in a Hyper Text Mark up Language.
It’s most common application is to style web pages written in HTML and XHTML.
Please download the attached PDF document for its tags and tutorials.
The SPAN and DIV HTML Elements
How to Use SPAN and DIV with CSS on Web Pages
The SPAN and DIV elements are very useful when dealing with CSS(Cascading Style Sheets).
These two elements in a similar fashion, but they serve different purposes.
The DIV Element :The DIV elements define logical divisions in your web page. It acts a lot like a <P> element, by placing newlines before and after the division. A division can have multiple paragraphs in it.
Using the DIV Tag
To use the DIV element, simply surround the area of your page that you want as a separate division with the <div> and </div> tags:
<p>contents of div</p>
The DIV element gives you the chance to define the style of whole sections of the HTML. You can define a division of your page as a call out and give that area a different style from the surrounding text. That area could have images, paragraphs and headlines, anything you wanted. The DIV element also gives you the ability to ID areas of your documents so that you can change them with Ajax and dynamic HTML.
The DIV element is different in new HTML5 SECTION element because it does not give the enclosed content any semantic meaning. If you aren’t sure whether the block of content should be a DIV or a SECTION, think about what that content’s purpose is and why you need the DIV or SECTTION element.
1. If you need the element simply to add styles to that area of the page, you should use the DIV element.
2. If that area of the page has a specific meaning, for example it holds all your social media elements or it contains your blogroll, then you should use the SECTION element.
One thing to keep in mind when using the DIV element is that it breaks paragraphs. It acts as a paragraph end/beginning, and while you can have paragraphs within a DIV you can’t have a DIV inside a paragraph.
The primary attributes of the DIV element are:
Even if you don’t use style sheets or DHTML, you should get into the habit of using the DIV element. This will give you more flexibility and future proof your HTML. Also, you can use the id to identify your divisions so that your web pages are well formed.
Because the CENTER element has been deprecated in HTML 4.0 and is obsolete in HTML5, it is a good idea to start using <div style=”text-align: center;”> to center the content inside your DIV.
Learn More About the DIV Element
The SPAN Element
The SPAN element has very similar properties to the DIV element, in that it changes the style of the text it encloses. But without any style attributes, the SPAN element won’t change the enclosed items at all.
The primary difference between the SPAN and DIV elements is that SPAN doesn’t do any formatting of it’s own. The DIV element includes a paragraph break. The SPAN element simply tells the browser to apply the style rules to whatever is within the SPAN.
To use the SPAN element, simply surround the text that you want to add styles to with the<span> and </span> tags:
<p><span class=”highlight”>Highlighted text</span> and non-highlighted text.</p>
The SPAN element has no required attributes, but the three that are the most useful are the same as for the DIV element:
Use SPAN when you want to change the style of elements without placing them in a new block-level element in the document. For example, if you had a Level 3 Heading (H3) that you wanted the second word to be red, you could surround that word with <span style=”color : #f00;”>2ndWord</span> and it would still be a part of the H3 tag, just red. For example:
<h3>This is My <span style=”color: red;”>Awesome</span> Headline</h3>