Friday, June 7, 2013

PHP

1 Welcome to PHP! 

An introduction to the PHP programming language.

Introduction to PHP

  PHP is a programming language that can do all sorts of things: evaluate form data sent from a browser, build custom web content to serve the browser, talk to a database, and even send and receive cookies (little packets of data that your browser uses to remember things

Why Learn PHP?
php can write to server java can write to client  
<?php echo "My first line of PHP!" ?>

Just a New Tag
<?php echo 40 + 2; ?>
A Bit of PHP History

PHP (originally Personal Home Page, but now PHP: Hypertext Preprocessor) was created by Rasmus Lerdorf in 1995. Lerdorf came up with PHP just to maintain his personal home page (hence the name), but it has since grown to become one of the most popular programming languages in use today.

Echo

<?php echo "Ajab!"; ?>
Arithmetic

<?php echo 17 * 123;>
Strings

A string is a word or phrase between quotes. You can type a string all at once  "ajab khan"; Or use the concatenation operator, which glues several strings together:"ajab"."khan";

Variables

A variable is just a name PHP uses to keep track of a value. <?php $ajab="text"; ?>

Semicolons (;)

You can think of a statement is a complete   <?php  echo "ajab";?>

Comments

short <?php //hellow this is comment ?>
  long
<!-- this one is also comment -->

Thursday, June 6, 2013

Web Fundamentals

1.Introduction to HTML

This unit will introduce you to the basics of HTML, the language used to create websites.

HTML Basics

                          Why learn HTML?
Every webpage you look at is written in a language called HTML. You can think of HTML as the skeleton that gives every webpage structure. In this course, we'll use HTML to add paragraphs, headings, images and links to a webpage.
                         HTML and CSS
HTML stands for HyperText Markup LanguageHypertext means "text with links in it." Any time you click on a word that brings you to a new webpage, you've clicked on hypertext!
                Basic terminology
To learn more HTML, we should learn how to talk about HTML. Already you have seen we use <>s a lot.                Make the head
Add a <head> opening and </head>closing tag. See the Hint for more.
Between the <head> tags, add in opening <title> and closing</title> tags.    
                           Paragraphs in the body

<!DOCTYPE html>
<html>
<head>
<title>title</title>
</head>
<body>
    <p>text</p>
    <p>text</p>
</body>
</html>
2. Body elements
Paragraphs and headings
<body>
<h1>Learning Html</h1>
        <p>Headdings are very easy to learn</p>
        <p>But this is not headding its a paragraph</p>
</body>
More about headings!
<body>
<h1>The Ceo</h1>
        <h2>VP</h2>
        <h3>Director</h3>
        <h4>Middle</h4>
        <h5>Low</h5>
        <h6>Gets</h6>
<h1>Learning Html</h1>
        <p>dkfjsl</p>
        <p>kjlkfjsl</p>
        <p>ljfslkjf</p>
        <p>Headdings are very easy to learn</p>
        <p>But this is not headding its a paragraph</p>
</body>
Using every heading
<body>
<h1>The Ceo</h1>
        <h2>VP</h2>
        <h3>Director</h3>
        <h4>Middle</h4>
        <h5>Low</h5>
        <h6>Gets</h6>
<body>
Mid-lesson breather
<!DOCTYPE html>
<html>
<head>
<title>Result website</title>
</head>
<body>
    <h3>headdding</h3>
    <p>paragraph</p>
    <p>paragraph</p>
    <p>paragraph</p>
</body>
</html>
Adding images
<body>
  <img src="http://i1061.photobucket.com/pic.jpg" />
</body>
Click that image
<a href="http://"www.google.com""> <img src="http://bit.ly/PK1euu" /></a>
Images and links

<a href="http://www.google.com" ><img src="pic.jpg" /></a>
    <img src="http://profile.ak.fbcdn.net/pic.jpg" />
    <a href="http://www.google.com">text</a>
Congratulations!
Well done! You now know the basics of creating a web page.

Project: Build Your Own Webpage

2.HTML Structure:Using Lists

In this unit, we'll cover more advanced HTML structure and begin customizing your pages.

HTML Basics II

Introduction
Let's get warmed up by adding a<title> in the <head>.
In the body, create a paragraph (using<p>). Write anything you like!
Indentation is your friend
style of codding is called indentation
        <!DOCTYPE html>
        <html>
     <head>
   <title></title>
</head>
<body>
</body>
</html>
Ordered lists
<h3>'List of things I find Ok'.</h3>
            <ol>
                <li>item one</li>
                <li>item two</li>
             </ol>
One more ordered list
            <ol>
                <li>item one</li>
                <li>item two</li>
             </ol>
Unordered lists
<ul>
            <li>one</li>
            <li>two</li>  
</ul>
Lists inside a list
<ol>
<li>Dad's interests
<ul> <li>knitting</li>
</ul>
</ol>
<ul>
                    <li>Fav boy name</li>
         <ol>         <li>ameer</li>
         </ol>
</ul>
Making comments
<!---Make me into a comment.---->
Font size
<p style="font-size:10px">text</p>
    <p style="font-size:20px">text</p>
    <p style="font-size:40px">text</p>
Font color
<h1 style="color:green;font-size:16px">Green</h1>
<p style="color:violet">Violet.</p>
<p style="color:red; font-size:10px">Red</p>
Font family
<ol>        <li style="font-family:Garamond;font-size:16px">text</li>
               <li style="font-family:Verdana;font-size:12px">text</li>
              <li style="font-family:Impact;font-size:10px">text</li>            </ol>
Recap
For the paragraph on line 7, make the font have:
a. A size of 20px             b. A color of blue             c. A font-family of Garamond
Background color
<body style="background-color:brown">
<h3>Favorite Football Teams</h3>    <ol style="background-color:yellow">
<li>The Hawthorn Football Club</li>
</ol>
Aligning the text
<ol> <li style="text-align:left">The Hawthorn Football Club</li>
<li style="text-align:center">San Franscisco 49ers</li>
<li style="text-align:right">Barcelona FC</li> </ol>
Strong words!
<p>Do you hear the people <strong>sing</strong>?</p>
Emphasize words!
<p>Hey, don't say <em>that</em>!</p>
Summary
  • Make ordered and unordered lists   . Change the color, size and type of font
  • Add comments to our HTML file        .Change the page's background color
  • Align text                                           .Bold and italicize text
Project: Social Networking Profile







3. HTML Structure: Tables,Divs, and Spans

In this unit, we'll use tables, divs, and spans to flesh out our pages and make them capable of a wide range of content and style.

HTML Basics III