Tuesday, July 21, 2015

PHP AND MY SQL TUTORIAL FREE

PHP AND MY SQL TUTORIAL FREE.

introduction 

php stand for hyper text  pre-processor which is an open source web development language used for dynamic website.and application also.
or in other words we say PHP is a server side scripting language software or tools which is used for creating powerful dynamic website ,web application and desktop application.
php is used free for web programing language which is used for creating interactive website.
php is a server side web development language which must require a server for execution.

what can we create with php.

  • we can create web applications using php.
  • we can create dynamic website using php.
  • we can create social network sites using php such as facebook ,twittwer and my space etc.
  • we can create e-commerce online shopping stores such as olx.com
  • we can create news sites such as bbc.com 
  • we can create small applications such as online clocks ,calculators ,image sliders ,love converters ,visitor counter etc
  • we can create desktop applications such as data storing software ,image editing software etc

how does php works.

php codes can be written inside html document,but php require a web server in order to be executed .
php is actually software which is installed on a web server from where it performs the tasks given by developers and return the out put on visitors 'browser within millisecond.
php syntax is little bit simple and similar to java and asp of Microsoft.
php can be written inside html document anywhere in the <body> section or in the <head> section or outside the html tag.
a simple php script is written like as 
<?php
code is here
?

TOOLS REQUIRED TO RUN PHP;

  • a web server (for performing all tasks)
  • a database (storing data)
  • a latest version of php software
  • a text editor 
  • a web browser(for viewing the output)
the best software for this process is ''wamp'' which is include all option like php,apache server ,mysql database etc

Execute PHP Online

For most of the examples given in this tutorial you will find Try it option, so just make use of this option to execute your PHP programs at the spot and enjoy your learning
try the following codes as given below

PHP - Coding Standard

Every company follows a different coding standard based on their best practices. Coding standard is required because there may be many developers working on different modules so if they will start inventing their own standards then source will become very un-manageable and it will become difficult to maintain that source code in future.
Here are several reasons why to use coding specifications:
  • Your peer programmers have to understand the code you produce. A coding standard acts as the blueprint for all the team to decipher the code.
  • Simplicity and clarity achieved by consistent coding saves you from common mistakes.
  • If you revise your code after some time then it becomes easy to understand that code.
  • Its industry standard to follow a particular standard to being more quality in software.
There are few guidelines which can be followed while coding in PHP.
  • Indenting and Line Length - Use an indent of 4 spaces and don't use any tab because different computers use different setting for tab. It is recommended to keep lines at approximately 75-85 characters long for better code readability.
  • Control Structures - These include if, for, while, switch, etc. Control statements should have one space between the control keyword and opening parenthesis, to distinguish them from function calls. You are strongly encouraged to always use curly braces even in situations where they are technically optional.
  • Examples:
    if ((condition1) || (condition2)) {
        action1;
    } elseif ((condition3) && (condition4)) {
        action2;
    } else {
        default action;
    }
    You can write switch statements as follows:
    switch (condition) {
    case 1:
        action1;
        break;
    
    case 2:
        action2;
        break;
    
    default:
        defaultaction;
        break;
    }
  • Function Calls - Functions should be called with no spaces between the function name, the opening parenthesis, and the first parameter; spaces between commas and each parameter, and no space between the last parameter, the closing parenthesis, and the semicolon. Here's an example:
    $var = foo($bar, $baz, $quux);
    
  • Function Definitions - Function declarations follow the "BSD/Allman style":
    function fooFunction($arg1, $arg2 = '')
    {
        if (condition) {
            statement;
        }
        return $val;
    }
  • Comments - C style comments (/* */) and standard C++ comments (//) are both fine. Use of Perl/shell style comments (#) is discouraged.
  • PHP Code Tags - Always use <?php ?> to delimit PHP code, not the <? ?> shorthand. This is required for PHP compliance and is also the most portable way to include PHP code on differing operating systems and setups.
  • Variable Names -
    • Use all lower case letters
    • Use '_' as the word separator.
    • Global variables should be prepended with a 'g'.
    • Global constants should be all caps with '_' separators.
    • Static variables may be prepended with 's'.
  • Make Functions Reentrant - Functions should not keep static variables that prevent a function from being reentrant.
  • Alignment of Declaration Blocks - Block of declarations should be aligned.
  • One Statement Per Line - There should be only one statement per line unless the statements are very closely related.
  • Short Methods or Functions - Methods should limit themselves to a single page of code.
There could be many more points which should be considered while writing your PHP program. Over all intension should be to be consistent throughout of the code programming and it will be possible only when you will follow any coding standard. YOu can device your own standard if you like something different.

PHP & MySQL

MySQL is the most popular Open Source Relational SQL database management system. MySQL is one of the best RDBMS being used for developing web-based software applications.
This tutorial will give you quick start with MySQL and make you comfortable with MySQL programming.

Audience

This reference has been prepared for the beginners to help them understand the basics to advanced concepts related to MySQL languages.

Prerequisites

Before you start doing practice with various types of examples given in this reference, I'm making an assumption that you are already aware about what is database, especially RDBMS and what is a computer programming language.

MySQL Database Export - Backup Methods

The simplest way of exporting a table data into a text file is using SELECT...INTO OUTFILE statement that exports a query result directly into a file on the server host.

Exporting Data with the SELECT ... INTO OUTFILE Statement:

The syntax for this statement combines a regular SELECT with INTO OUTFILE filename at the end. The default output format is the same as for LOAD DATA, so the following statement exports the tutorials_tbl table into /tmp/tutorials.txt as a tab-delimited, linefeed-terminated file:
mysql> SELECT * FROM tutorials_tbl 
    -> INTO OUTFILE '/tmp/tutorials.txt';
You can change the output format using options to indicate how to quote and delimit columns and records. To export the tutorial_tbl table in CSV format with CRLF-terminated lines, use this statement:
mysql> SELECT * FROM passwd INTO OUTFILE '/tmp/tutorials.txt'
    -> FIELDS TERMINATED BY ',' ENCLOSED BY '"'
    -> LINES TERMINATED BY '\r\n';
The SELECT ... INTO OUTFILE has the following properties:
  • The output file is created directly by the MySQL server, so the filename should indicate where you want the file to be written on the server host. There is no LOCAL version of the statement analogous to the LOCAL version of LOAD DATA.
  • You must have the MySQL FILE privilege to execute the SELECT ... INTO statement.
  • The output file must not already exist. This prevents MySQL from clobbering files that may be important.
  • You should have a login account on the server host or some way to retrieve the file from that host. Otherwise, SELECT ... INTO OUTFILE likely will be of no value to you.
  • Under UNIX, the file is created world readable and is owned by the MySQL server. This means that although you'll be able to read the file, you may not be able to delete it.

Exporting Tables as Raw Data:

The mysqldump program is used to copy or back up tables and databases. It can write table output either as a raw datafile or as a set of INSERT statements that recreate the records in the table.
To dump a table as a datafile, you must specify a --tab option that indicates the directory, where you want the MySQL server to write the file.
For example, to dump the tutorials_tbl table from the TUTORIALS database to a file in the /tmp directory, use a command like this:
$ mysqldump -u root -p --no-create-info \
            --tab=/tmp TUTORIALS tutorials_tbl
password ******

Exporting Table Contents or Definitions in SQL Format:

To export a table in SQL format to a file, use a command like this:
$ mysqldump -u root -p TUTORIALS tutorials_tbl > dump.txt
password ******
This will a create file having content as follows:

-- MySQL dump 8.23
--
-- Host: localhost    Database: TUTORIALS
---------------------------------------------------------
-- Server version       3.23.58

--
-- Table structure for table `tutorials_tbl`
--

CREATE TABLE tutorials_tbl (
  tutorial_id int(11) NOT NULL auto_increment,
  tutorial_title varchar(100) NOT NULL default '',
  tutorial_author varchar(40) NOT NULL default '',
  submission_date date default NULL,
  PRIMARY KEY  (tutorial_id),
  UNIQUE KEY AUTHOR_INDEX (tutorial_author)
) TYPE=MyISAM;

--
-- Dumping data for table `tutorials_tbl`
--

INSERT INTO tutorials_tbl 
       VALUES (1,'Learn PHP','John Poul','2007-05-24');
INSERT INTO tutorials_tbl 
       VALUES (2,'Learn MySQL','Abdul S','2007-05-24');
INSERT INTO tutorials_tbl 
       VALUES (3,'JAVA Tutorial','Sanjay','2007-05-06');
To dump multiple tables, name them all following the database name argument. To dump an entire database, don't name any tables after the database as follows:
$ mysqldump -u root -p TUTORIALS > database_dump.txt
password ******
To back up all the databases available on your host, use the following:
$ mysqldump -u root -p --all-databases > database_dump.txt
password ******
The --all-databases option is available as of MySQL 3.23.12.
This method can be used to implement a database backup strategy.

Copying Tables or Databases to Another Host:

If you want to copy tables or databases from one MySQL server to another, then use mysqldump with database name and table name.
Run the following command at source host. This will dump complete database into dump.txt file:
$ mysqldump -u root -p database_name table_name > dump.txt
password *****
You can copy complete database without using a particular table name as explained above.
Now, ftp dump.txt file on another host and use the following command. Before running this command, make sure you have created database_name on destination server.
$ mysql -u root -p database_name < dump.txt
password *****
Another way to accomplish this without using an intermediary file is to send the output of mysqldump directly over the network to the remote MySQL server. If you can connect to both servers from the host where source database resides, use this command (Make sure you have access on both the servers):
$ mysqldump -u root -p database_name \
       | mysql -h other-host.com database_name
The mysqldump half of the command connects to the local server and writes the dump output to the pipe. The remaining mysql half of the command connects to the remote MySQL server on other-host.com. It reads the pipe for input and sends each statement to the other-host.com server.

Monday, July 20, 2015

DREAMWEAVER (WEB DESIGNING) COMPLETE TUTORIAL

DREAMWEAVER (WEB DESIGNING) COMPLETE TUTORIAL
Dreamweaver cs5 is the most used desktop application/software for create any type of website using html/css and php/asp.this is all in one offline software which you can use to develop website template/layouts just by clicking using simple GUI (general using interface).
in this tutorial you will learn the basic fundamental of dream weaver .you shall also learn some advance technique to create your own website using Dreamweaver.
or we can also explain dreamweaver is software of adobe corporation which is design to create web templates and to use all the latest web technologies or web languages with easy step and clicks.
dreamweaver supports all the web languages and formats  such as html 'JavaScript,php,asp,asp.net,perl,python, java and many other languages.
dreamweaver also support programming language such as c# ,c++,and Microsoft.net technology.
dreamweaver is used to save time and work faster than writing code in a text editor such as notepad etc.
dreamweaver is easy tool to create website in a hour even in minute.
dreamweaver has a lot of sample to create website from and it also gives you every tag of every language to insert by using simple clicks.
for example
i want to make a text bold,for this i shall have to a html code in notepad myself like this
;<b>bold text here</b>
the same thing i can do in dreamweaver by simple clicking the b option in dreamweaver and the html code <b></b> will be inserted automatically by dreamweaver .isnot cool.

what should you know already

it is good that you know already about css and html knowledge.
it is also good that you have knowledge of java and php
while every one uses dreamweaver for their own purposes ,such as web designer uses it for designing a template ,while a php user uses it for development ann application.


How to Change Fonts, Text Colour and Size with Dreamweaver 

the font size field comprises two column .you want to enter number into first box or column and a unit of measure into the 2nd .for example if you want the text to be 20% larger then current size ,enter ''120'' without quotes in first box and then click down arrow for the 2nd box and then select''%''.
if you are using ''%'' as you unit .100% is current size of the text .as such 130 % means that the text will be 30% greater than its current size and similarly 80% is less than 20% its current size.

Changing the Text Colour

to changing the text colour a clickable button in box nex tpo the word''colour''or ''color''
this box is actually a clickable button.although it doesnot look like  it.a colour picker window will pop up ,allowing you to click the color you want use.

                              if you change your mind about changing color just hit the esc key to get out of color pop up window.dont click anywhere else in dialog box otherwise the action dismiss.

Bold, Italics, Underline

if you are changing the fonts or its color ,and also want to put your words in bold or italic or underline them it is possible within this dialogue box .''bold'' can be selected from the "Font-weight" field, "Italics" from "Font-style", and the "underline" checkbox can be found in the "Text decoration" list.
Having said that, if your aim is only to put some words in bold or italics to emphasize them in a particular sentence, there's no need to create a new class just for that purpose. There's a better (and simpler) way to do that, which will be explained later in this chapter.
As for underlining, unless you have a good reason for it, most webmasters actually avoid underlining text for emphasis. By convention, on the Internet, underlining is usually reserved for links. This is by no means a rule, of course. But over the many years in which websites have existed, users have come to expect that any underlined text represents a clickable link. Maintaining this convention is considered good practice, since it will give your visitors an easier time navigating your site. If you want to emphasize something, use bold or italics instead.
When you've completed everything you need to do in this dialog box, click the OK button.
The dialog box will disappear, and you'll probably be disappointed to find that nothing has changed on your page. If so, remember that you have only created the CSS rules for a new class. You haven't actually assigned that class to anything yet.
To apply your changes to a piece of text on your page, first select that snippet of text. Selecting text, if you will remember from the previous chapters, simply means highlighting it. And you can do it by dragging your mouse over the words you want.
Go to the next step without doing anything else on your page, otherwise you might accidentally remove the selection.

Click the drop down box for the "Class" field in the Properties panel, and select the class you just created earlier. For example, if you created a class named "productname", click the line that says "productname" in the drop down list that appears.
The text you selected will immediately take on the characteristics you defined earlier.
If you have tried changing the size, and don't notice any visible change, it may mean that the size difference you made are too small to be depicted on the screen. For example, putting a size of "101%" or "99%", where the difference is only 1%, will probably result in nothing appearing to happen. In addition, if your text completely disappears, it may mean that you have accidentally set the text colour to white ("#FFF" in the colour field). White text on a white background does not lead to an enriching reading experience.

You can also select other pieces of text on your page, and assign them the same class. That is, a class can be assigned to as many objects on your web page as you want. (Note that "objects" in this context just means something on your web page. It can be a picture, words, phrases, sentences, paragraphs, the whole column, the whole page, or whatever.) For example, if you have listed many different products on your web page, and want every mention of your product to be displayed using the rules you created earlier, simply repeat the above procedure for every instance of your product name: that is, just select the word, phrase, sentence, paragraph (or whatever), click the "Class" field in the Properties panel, and choose the appropriate class.

If you want something to have a different appearance (eg, if you want yet another font for a different snippet of text), just create a new class and specify the appearance you want in the rules for the class. Then select (highlight) the text as before and assign it the class you created.
             

How to Change the Default Font for the Entire Web Page in Dreamweaver 

if you want to change the default font used by Dreamweaver for all the text on your web page, you do not have to specially create a new class. Simply do the following.
  1. The simplest way to do this to click "Modify | Page Properties" from the menu.
  2. The "Page Properties" dialog box will appear. Look for the "Page font" field on the right side. It should show "Verdana, Arial, Helvetica, sans-serif". Click the drop down arrow for the box and select the font you want.
Click the "OK" button.

How to Change the Font for the Entire Left or Right Columns in Dreamweaver.

To change the font for the entire left or right columns, all you need to do is to modify the existing class that Dreamweaver has created for that particular column. In other words, there's no need to create a new class for this purpose. To produce the visual effect of having two columns, Dreamweaver created a number of default classes for your layout, including one that encompasses all the content in the left column, and one the right.
  1. Click somewhere in the column in question. That is, if you want to change the font for all the text in the left column, click somewhere in the left column (I suggest somewhere within the paragraph of text that begins "The above links demonstrate a basic navigational...", etc). Likewise, if you want to change the font for your right column, click somewhere in that column.
  2. For the left column, doubleclick the line that begins with ".sidebar1" in the Rules section of the CSS Panel. If you're customising the right column, doubleclick the line that begins with ".content".
  3. This will invoke the CSS Rule Definition dialog box for either ".sidebar1" (if you're changing the font for the left column) or ".content" (if you're changing the right column).
    Make your changes and click the "OK" button when you're through.

Saving Your Work the Correct Way.

Save your work by clicking "File | Save All" from the menu. Notice that I said to use "File | Save All" and not "File | Save". This is important because all the CSS classes and rules that you created were inserted into the CSS file ("twoColLiqLtHdr.css") and not the "index.html" file. If you only use "File | Save", you will only save your modified "index.html" file, but not the (also modified) CSS file. The end result is that none of the visual changes you make will be seen on your website when you publish it.

Publishing and Testing.

if you are really sure you saved your CSS file and uploaded the latest copy, is that your web browser is showing you an old copy of your website. Web browsers sometimes store a copy of websites you visit on your computer so as to be able to respond faster to your commands. While this is actually a good thing for the most part, making your web browsing experience more pleasant, it can sometimes work against you when you end up seeing old copies of portions of your site. To force the web browser to really show you the new page, hit the "Reload" button in your browser. (The "Reload" button is the one with the circular arrow icon in many browsers.)
Note that it's not always the web browser's fault when you see old versions of your web page. It may sometimes be the fault of your broadband provider (called Internet Service Provider, or ISP). Some ISPs cache copies of the pages you visit using something known as "proxies". If they don't configure their proxies correctly, you may end up seeing new copies of your "index.html" alongside old copies of your CSS or image files. The only solution available to you at your end (short of complaining to your service provider) is to use the "Reload" button on your web browser, and hope that the proxy takes a hint when your browser asks for the page again.

Sunday, July 19, 2015

css 3 complete tutorial

CSS 3 COMPLETE TUTORIAL

css means 'cascading style sheet'.which is used to design website layout.and the css 3 is the latest version of css.it is the tool which gives you the energy to make professional layout of web and with advanced option.this course of css3 is advanced and i think it gives you so many ideas to post in your web project.in other words we say it is a web pages which is written in the form of html, x html, XML etc.
and we also say css is a web language which is used for adding formatting to web pages and applications.
css3 released in 2012 and it is still major css tool in all browser.

how does css work

  • css is used within html document and it work as a style sheet.
  • css is a loosly written web language which can be written inside html  tags.
  • css have their selectors and selector have their own properties and value.
  • css can be written internally ,externally and within lines.
  • css is suported by all major browsers like google chrome,mozila firefox,opera mini,internet explore etc.

syntax of css

css syntax is as follow
           1)selector    2)property    3)value
h1{color :red;}
one selector have many properties like:
H1{color:red;size 12 px;; background;red;}
     all html tags are default selectors in css,and users defined  selectors are called ids and classess in css.

method of css in html

there are 3 method ,by using which you can write css code  inside html documents;
  1. external method                                                                                                                                        <link rel='stylesheet' href='style.css'>
  2. internal method.                                                                                                                                                 <style>code is written here</style>
  3.  inline method                                                                                                                                                      <p style='color; red;'>this is a pragraph!</p>        

what can we do with the help of css   


  • we can create website layouts wih css
  • we can create horizontal and vertical menus in css.
  • we can create drop downs menus with the help of css
  • we can create image gallerias using css
  • we can create web templates with css
  •    we can create animation with the help of css
  • we can create object using css
  • we can create rounded borders using css.

requirements 

  • basic understanding of computer and internet , html knowledge will be bonus
  • a text editor to write code in such as notepad ++, Dreamweaver, sublime text etc
  • a browser to view the output like mozila firefox or google chrome.
border and radius code  

you can manually use your default figure but here is only example of css code
     -webkit-border-radius: 13px 16px 23px 16px;

border-radius: 13px 16px 23px 16px;

box shadow code

-webkit-box-shadow:inset 22px 12px 21px 12px #FF6421;
box-shadow:inset 22px 12px 21px 12px #FF6421;

multiple column

-moz-column-count: 3;
-moz-column-gap: 21px;
-webkit-column-count: 3;
-webkit-column-gap: 21px;
column-count: 3;
column-gap: 21px;

outline dotted

outline: 21px dotted #171FFF;
outline-offset: 21px;

text shadowing

text-shadow: 12px 32px 13px #19FF19;

some screenshots of css code




through this tutorial i think you got some idea and totally understand on css 3.the best text editor tool is sublime text i personaly used it and it is good.