This action might not be possible to undo. Are you sure you want to continue?
Building Static Sites through HTML HTML is a computer language devised to allow website creation. These websites can then be viewed by anyone else connected to the Internet. It is relatively easy to learn; and quite powerful in what it allows you to create. It is constantly undergoing revision and evolution to meet the demands and requirements of the growing Internet audience under the direction of the » W3C, the organisation charged with designing and maintaining the language. The definition of HTML is HyperText Markuge Language. HyperText is the method by which you move around on the web — by clicking on special text called hyperlinks which bring you to the next page. The fact that it is hyper just means it is not linear — i.e. you can go to any place on the Internet whenever you want by clicking on links — there is no set order to do things in. Markup is what HTML tags do to the text inside them. They mark it as a certain type of text (italicised text, for example). HTML is a Language, as it has code-words and syntax like any other language.
it is a markup language ° A markup language is a set of markup tags ° HTML uses markup tags to describe web pages What are HTML Tags ? The tags are what separate normal text from HTML code.HTML is a language for describing web pages. They allow all the cool stuff like images and tables and stuff. The tags themselves don’t appear when you view your page through a browser. ° HTML stands for Hyper Text Markup Language ° HTML is not a programming language. like this: <b>These words will be bold</b>. You might know them as the words between the <angle-brackets>. Different tags will perform different functions. just by telling your browser what to render on the page. The simplest tags do nothing more than apply formatting to some text. and these will not. . but their effects do.
you can use either the . the second tag is the end tag -Start and end tags are also called opening tags and closing tags Getting Started with HTML What you need? HTML is written simply in a plain text editor like Notepad. But we will be using advanced text editor Notepad++ (provided to you on NeepanTech. Expression Web & Dreamweaver.html extension.com Website and also with your Neepan Tech Package DVD). With new software it is perfectly safe to use . Advanced developers also use softwares like Frontpage. We use .HTML markup tags are usually called HTML tags -HTML tags are keywords surrounded by angle brackets like <html> -HTML tags normally come in pairs like <b> and </b> -The first tag in a pair is the start tag.htm in our examples. HTM or HTML Extension ? When you save an HTML file. How to Save HTML Web Page.html .htm or the .
Always you have to Start the HTML Page with opening HTML and Body Tags <html> and <body> and after putting all the content you need in the Web Page. in the order they were opened. HTML Elements.The text between <body> and </body> is the visible page content This is the common structure of all the HTML Web Pages. <html> <body> Hello. </body> </html> Example Explained . How are you.Understand the HTML Web Page Structure. . An HTML element is everything from the start tag to the end tag.The text between <html> and </html> describes the web page . You need to close the opened tags by </body> and </html>.
.” is known as the element content.</p> Illustration Explained Here everything for start paragraph tag to end tag is the HTML Element. HTML Basic Tags Explained. . <H5> and <H6> tags. . <H4>.The element content is everything between the start and the end tag.Empty elements are closed in the start tag.An HTML element starts with a start tag / opening tag. <H2>.Some HTML elements have empty content. <h1> defines the largest heading and <h6> defines the smallest heading. Heading Tags There are six levels of headings in HTML specified by <H1>. . <H3>.Most HTML elements can have attributes. HTML Element Syntax .Illustration <p>This is Some Content. The content between the tags “This is Some Content. . .An HTML element ends with an end tag / closing tag.
Some other Useful Tags.com">Neepan Tech Home Page. Line Breaks etc.</a> </body> </html> Illustration Output Neepan Tech Home Page. HTML Comments. We will now discuss some other useful tags like HTML Rules.Paragraph Tag Illustration Explained HTML Paragraph element are defined with the <p> tags. .neepantech. Illustration <html> <body> <a href="http://www. Always rememeber to close the paragraph tag when a particular paragraph is written completely.
My Second Heading.Drawing HTML Rules <HR> (Horizontal Rule) is a stand alone tag that generates a horizontal line. Illustration <html> <body> <h1>My First Heading. . My First Heading.</h1> <hr> <h2>My Second Heading.</h2> </body> </html> Illustration Output. Rules Tag Illustration Explained The <hr> Tag generates a horizontal line between the 2 Headings. There is no corresponding HTML command for a verticle line.
this includes any HTML tags. Marquee <sup> (Superscript) is a tag that makes any text between <sup> tags to be formatted as subscripted. type size. Use the <br> tag.HTML Comments All combinations of text placed within the comment tags will be ignored by the web browser. Line Breaks To break the line and move to the next line. scripting language(s). etc. which modern browsers support. The best way to do that is with a Cascading Style Sheet (CSS). You always had to remember closing the superscript tag after you have formatted the required text. Font family. HTML Styling Tags You may want to change the way the generated HTML output looks. and other styles can be controlled with CSS for each kind of element. colors. Connect CSS to a Webpage .
Illustration <link rel="stylesheet" href="stylesheet.css" type="text/css"> Illustration Explained The above tag. A simple HTML table consists of the table element and one or more tr. The tr element defines a table row. HTML List Tags Words or phrases which need to be set apart from the rest of the body of text can be emphasized with a “bullet”. The link is to be put in the <HEAD> element. HTML Table Tags The <table> tag defines an HTML table. and the td element defines a table cell. th.Insert the link of CSS Files into the HTML file. links the CSS file named “stylesheet. . and td elements.css” to the current Web page. the th element defines a table header.
It is used to itemize elements of “unordered” and “ordered” lists. either until another list tag is detected or until the end of the list is reached. Each list item starts with the <li> tag. An unordered list starts with the <ul> tag.List Tag <LI>: creates a bullet in front of text which is to be set apart for emphasis and causes all text after it to be indented. The list items are marked with bullets (typically small black circles). Illustration <html> <body> <ul> <li>January</li> <li>February</li> </ul> . Unordered List An unordered list is a list of items.
A form is defined with the <form> tag. drop-down menus. . Designing HTML Forms A form is an area that can contain form elements. Ordered List An ordered list is also a list of items. Each list item starts with the <li> tag. textarea fields. radio buttons. Form elements are elements that allow the user to enter information (like text fields. An ordered list starts with the <ol> tag. checkboxes.</body> </html> Illustration Output -January -February Unordered List Illustration Explained January & February are put in Bullet as they are inside an <ul> unordered list tags. The list items are marked with numbers.) in a form. etc.
style. and manipulate. numbers. What this means is that a <div> tag defines sections of a Web page to make it easier to manage. "maincontent". etc. Radio Button Radio Buttons are used when you want the user to select one of a limited number of choices. in a form. <div id ="maincontent"> <div> Tag Illustration Explained We can then give any design or position to the easily to the <div> using the CSS. What are <div> Tags The <div> tag in XHTML is a tag that defines logical divisions within the content of a page.Textfield Text fields are used when you want the user to type letters. Checkbox Checkboxes are used when you want the user to select one or more options of a limited number of choices. .
" This is generally a good definition of PHP. .HotScripts for examples of the great things that are possible with PHP . . Another way to think of PHP is a powerful. behind the scenes scripting language that your visitors won't see! PHP .Allow creation of shopping carts for e-commerce websites.What is it? Taken directly from PHP's home.PHP .What's it do? It is also helpful to think of PHP in terms of what it can do for you. Check out PHP . "PHP is an HTML-embedded scripting language.Create a customized user experience for visitors based on information that you have gathered from them. PHP will allow you to: . . However.Reduce the time to create large websites. PHP.net. The goal of the language is to allow web developers to write dynamically generated pages quickly. Much of its syntax is borrowed from C.Open up thousands of possibilities for online tools. it does contain a lot of terms you may not be used to. Java and Perl with a couple of unique PHP-specific features thrown in.
The rules that must be followed to write properly structured code. of sorts. All PHP code must be contained within the following. PHP Code <?php ?> or the shorthand PHP tag that requires shorthand support to be enabled on your server. Syntax .. Perl) with the addition that all PHP code is contained with a tag. PHP's syntax and semantics are similar to most other programming languages (C. let us first define what syntax is referring to...PHP – Syntax Before we talk about PHP's syntax. Java.. <? ?> .
then you must save the file with a .How to Save PHP Pages If you have PHP inserted into your HTML and want the web browser to interpret it correctly. instead of the standard .html extension. ?> </body> </html> Display Hello World! .php extension. PHP Code <html> <head> <title>My First PHP Page</title> </head> <body> <?php echo "Hello World!". So be sure to check that you are saving your files correctly.
You can also press tab to indent your code . This means it is OK to have one line of PHP code.White Space As with HTML. whitespace is ignored between PHP statements. then 20 lines of blank space before the next line of PHP code. PHP Code <html> <head> <title>My First PHP Page</title> </head> <body> <?php echo "Hello World!". echo "Hello World!". ?> </body> </html> Display Hello World!Hello World! .
$my_variable .Variables with more than one word can also be distinguished with capitalization. A variable can then be reused throughout your code.PHP variables must start with a letter or underscore "_". If you forget that dollar sign at the beginning. 0-9. . instead of having to type out the actual value over and over again. . a-z. it will not work.PHP Variables A variable is a means of storing a value.$variable_name = Value. $myVariable . such as text string "Hello World!" or the integer value 4. A-Z. or .PHP variables may only be comprised of alphanumeric characters and underscores. In PHP you define a variable with the following form: .Variables with more than one word should be separated with underscores. This is a common mistake for new PHP programmers! PHP Variable Naming Conventions There are a few rules that you need to follow when choosing a name for your PHP variables.
to create a string that the echo function will output. use the PHP echo function. ?> . like we have done in previous lessons. You can place either a string variable or you can use quotes. the PHP function echo is a means of outputting text to the web browser. echo $myString.PHP Echo As you saw in the previous lesson. PHP Code <?php $myString = "Hello!". echo "<h5>I love using PHP!</h5>". like we do below. So let's give it a solid perusal! Outputting a String To output a string. Throughout your PHP career you will be using the echo function more than any other.
e.Display Hello! I love using PHP! Careful When Echoing Quotes! It is pretty cool that you can output HTML with PHP. To escape a quote just place a slash directly before the quotation mark. See our example below for the right and wrong use of the echo function: PHP Code . i. so you must use one of the following tactics if your string contains quotations: Don't use quotes inside your string Escape your quotes that are within the string with a slash. However. \" Use single quotes (apostrophes) for quotes inside your string. you must be careful when using HTML code or any other string that includes quotes! The echo function uses quotes to define the beginning and end of the string.
PHP . so it is important to have a basic understanding of PHP strings. PHP Echo. we used strings a bit. // OK because we used an apostrophe ' echo "<h5 class='specialH5'>I love using PHP!</h5>". but didn't talk about them in depth. // OK because we escaped the quotes! echo "<h5 class=\"specialH5\">I love using PHP!</h5>". Throughout your PHP career you will be using strings a great deal.<?php // This won't work because of the quotes around specialH5! echo "<h5 class="specialH5">I love using PHP!</h5>".String Creation Before you can use a string you have to create it! A string can be used directly in a function or it can be stored in a variable. ?> PHP Strings In the last lesson. .
it is very commonly used in conjunction with PHP scripts to create powerful and dynamic server-side applications.MySQL Introduction MySQL is currently the most popular open source database server in existence. MySQL is a relational database. With a database you can group different parts of your business into separate tables to help store your information logically. say that you wanted to store information of all the employees in a company. A relational database is much more oriented to the human mind and is often preferred over the gabble-de-gook flat database that are just stored on hard drives like a text file. . On top of that. What is a database? A database is a structure that comes in two flavors: a flat database and a relational database. Why use a Database? Databases are most useful when it comes to storing information that fits into logical categories. For example.
echo "Connected to MySQL<br />".mysql connect Before you can do anything with MySQL in PHP you must first establish a connection to your web host's MySQL database. you then need to choose which . "admin". This is done with the MySQL connect function. "1admin") or die(mysql_error()). mysql localhost PHP & MySQL Code: <?php mysql_connect("localhost". ?> Display: Connected to MySQ Choosing the working Database After establishing a MySQL connection with the code above.
the goal is to store information in an orderly fashion. age) VALUES('Timmy Mellowman'. "admin". // Insert a row of information into the table "example" mysql_query("INSERT INTO example (name. PHP & MySQL Code: <?php // Make a MySQL Connection mysql_connect("localhost". MySQL Tables A MySQL table is completely different than the normal table that you eat dinner on. This is done with the mysql_select_db function. mysql_select_db("test") or die(mysql_error()). '23' ) ") or die(mysql_error()). "1admin") or die(mysql_error()).database you will be using with this connection. mysql_query("INSERT INTO example . In MySQL and other database systems.
that is for sure. echo "Data Inserted!". '15' ) ") or die(mysql_error()).(name. mysql_query("INSERT INTO example (name. age) VALUES('Sandy Smith'. Here is a sample SELECT query of a table we created in the MySQL Create Table lesson. ?> Display: Data Inserted! mysql_fetch_array: why use it? Do you know what is returned when you used the mysql_query function to query a MySQL database? It isn't something you can directly manipulate. '21' ) ") or die(mysql_error()). ?> . PHP and MySQL Code: <?php $result = mysql_query("SELECT * FROM example"). age) VALUES('Bobby Wallace'.
The value that mysql_query returns and stores into $result is a special type of data. Some potential reasons for deleting a record from MySQL include when: someone deletes a post from a forum. We need to choose a table. tell MySQL to perform the deletion. MySQL Delete Maintenance is a very common task that is necessary for keeping MySQL tables current. or you're trying to destroy your records before the federalies come! mysql delete example The DELETE query is very similar to the UPDATE Query in the previous lesson. From time to time. . and provide the requirements that a record must have for it to be deleted. an employee leaves a company. Additional PHP functions are required to extract the data from this Resource. you may even need to delete items from your database. it is a MySQL Resource.
be sure to back up the table/database in case your script takes off a little more than desired. ?> It is important to note that this query would have deleted ALL records that had an age of 15. Since Bobby was the only 15 year old this was not a problem. .PHP & MySQL Code: <?php // Connect to MySQL // Delete Bobby from the "example" MySQL table mysql_query("DELETE FROM example WHERE age='15'") or die(mysql_error()). Test your delete queries before even thinking about using them on your table. MySQL Delete Tips Before performing a large delete on a database. As long as you take caution when using this powerful query you should not run into any problems.