Published on

my ppt on lamp,ajax,css,html,web2.0

Published in: Education, Technology
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide


  1. 1. LINUX <ul><li>Linux is a generic term referring to the family of Unix-like computer operating systems that use the Linux kernel. </li></ul><ul><li>Their development is one of the most prominent examples of free and open source software collaboration; typically all the underlying source code can be used, freely modified, and redistributed, both commercially and non-commercially, by anyone under licenses such as the GNU General Public License. </li></ul>
  2. 2. <ul><li>Linux can be installed on a wide variety of computer hardware , ranging from embedded devices such as mobile phones, smartphones and wristwatches to mainframes and supercomputers . </li></ul><ul><li>Linux is predominantly known for its use in servers ; in 2007 Linux's overall share of the server market was estimated at 12.7%, while a 2008 estimate suggested that 60% of all web servers ran Linux. </li></ul><ul><li>Most desktop computers run either Mac OS X or Microsoft Windows , with Linux having only 1–2% of the desktop market. </li></ul><ul><li>However, desktop use of Linux has become increasingly popular in recent years, partly owing to the popular Mandriva Linux , Fedora , Debian or Ubuntu distributions and the emergence of netbooks and smartbooks . </li></ul>
  3. 3. Linux installation <ul><li>To install Red Hat, you will need to download the ISO images (CD Images) of the installation CD-ROMs from http://fedora.redhat.com </li></ul><ul><li>Download the i386 images for 32 Intel Processors, PPC images for for Apple Macintosh and x86_64 for for 64 bit AMD Processors </li></ul><ul><li>Burn the iso CD images on CDs and use these CDs as Installation CDs (typically 4) </li></ul>
  4. 4. Linux file structure <ul><li>In the Linux file structure files are grouped according to purpose. Ex: commands, data files, documentation. Parts of a Unix directory tree are listed below. </li></ul><ul><li>All directories are grouped under the root entry &quot;/&quot;. That part of the directory tree is left out of the below diagram. See the FSSTND standard (Filesystem standard) </li></ul><ul><li>* root - The home directory for the root user </li></ul><ul><li>* home - Contains the user's home directories along with directories for services </li></ul><ul><li>o ftp </li></ul><ul><li>o HTTP </li></ul><ul><li>o samba </li></ul><ul><li>o george </li></ul>
  5. 5. <ul><li>bin - Commands needed during bootup that might be needed by normal users </li></ul><ul><li>sbin - Like bin but commands are not intended for normal users. Commands run by LINUX. </li></ul><ul><li>proc - This filesystem is not on a disk. It is a virtual filesystem that exists in the kernels imagination which is memory. </li></ul><ul><li>A directory with info about process number 1. Each process has a directory below proc. </li></ul><ul><li>usr - Contains all commands, libraries, man pages, games and static files for normal operation. </li></ul><ul><li>bin - Almost all user commands. some commands are in /bin or /usr/local/bin. </li></ul><ul><li>sbin - System admin commands not needed on the root filesystem. e.g., most server programs. </li></ul><ul><li>include - Header files for the C programming language. Should be below /user/lib for consistency. </li></ul><ul><li>lib - Unchanging data files for programs and subsystems </li></ul>
  6. 6. <ul><li>local - The place for locally installed software and other files. </li></ul><ul><li>man - Manual pages </li></ul><ul><li>info - Info documents </li></ul><ul><li>doc - Documentation </li></ul><ul><li>tmp </li></ul><ul><li>X11R6 - The X windows system files. There is a directory similar to usr below this directory. </li></ul><ul><li>X386 - Like X11R6 but for X11 release 5 </li></ul><ul><li>boot - Files used by the bootstrap loader, LILO. Kernel images are often kept here. </li></ul><ul><li>lib - Shared libraries needed by the programs on the root filesystem </li></ul><ul><li>modules - Loadable kernel modules, especially those needed to boot the system after disasters. </li></ul><ul><li>dev - Device files </li></ul><ul><li>etc - Configuration files specific to the machine. </li></ul>
  7. 7. <ul><li>skel - When a home directory is created it is initialized with files from this directory </li></ul><ul><li>sysconfig - Files that configure the linux system for devices. </li></ul><ul><li>var - Contains files that change for mail, news, printers log files, man pages, temp files </li></ul><ul><li>file </li></ul><ul><li>lib - Files that change while the system is running normally </li></ul><ul><li>local - Variable data for programs installed in /usr/local. </li></ul><ul><li>lock - Lock files. Used by a program to indicate it is using a particular device or file </li></ul>
  8. 8. log - Log files from programs such as login and syslog which logs all logins and logouts. run - Files that contain information about the system that is valid until the system is next booted spool - Directories for mail, printer spools, news and other spooled work. tmp - Temporary files that are large or need to exist for longer than they should in /tmp. catman - A cache for man pages that are formatted on demand mnt - Mount points for temporary mounts by the system administrator. Tmp - Temporary files. Programs running after bootup should use /var/tmp.
  9. 9. Basic commands in linux 1.Cat : Sends file contents to standard output. This is a way to list the contents of short files to the screen. Example: cat .bashrc Description: It works well with piping. Sends the contents of the &quot;.bashrc&quot; file to the screen.
  10. 10. 2. Cd : Change directory Example: cd /home Description: Change the current working directory to /home. The '/' indicates relative to root, and no matter what directory you are in when you execute this command, the directory will be changed to &quot;/home&quot;. Example: cd httpd Description : Change the current working directory to httpd, relative to the current location which is &quot;/home&quot;. The full path of the new working directory is &quot;/home/httpd&quot;.
  11. 11. 3. Cp : Copy files Example : cp myfile yourfile Description : Copy the files &quot;myfile&quot; to the file &quot;yourfile&quot; in the current working directory. This command will create the file &quot;yourfile&quot; if it doesn't exist. It will normally overwrite it without warning if it exists. Example : cp -dpr srcdir destdir Description : Copy all files from the directory &quot;srcdir&quot; to the directory &quot;destdir&quot; preserving links (-p option), file attributes (-p option), and copy recursively (-r option). With these options, a directory and all it contents can be copied to another directory.
  12. 12. 4.Dd : Disk duplicate Example : dd if=/dev/hdb1 of=/backup/ Description: The man page says this command is to &quot;Convert and copy a file&quot;, but although used by more advanced users, it can be a very handy command. The &quot;if&quot; means input file, &quot;of&quot; means output file. 5. Df : Show the amount of disk space used on each mounted filesystem.
  13. 13. 6. ls :List files Example : ls Description : List files in the current working directory except those starting with . and only show the file name. Example : ls -al Description : List all files in the current working directory in long listing format showing permissions, ownership, size, and time and date stamp
  14. 14. 7. mv: Move or rename files Example : mv -i myfile yourfile Description : Move the file from &quot;myfile&quot; to &quot;yourfile&quot;. This effectively changes the name of &quot;myfile&quot; to &quot;yourfile&quot;. Example : mv -i /data/myfile . Description : Move the file from &quot;myfile&quot; from the directory &quot;/data&quot; to the current working directory.
  15. 15. 8. pwd :Show the name of the current working directory Example : more /etc/profile Description : Lists the contents of the &quot;/etc/profile&quot; file to the screen one page at a time.
  16. 16. APACHE
  17. 17. Apache <ul><li>The Apache is web server software notable for playing a key role in the initial growth of the World Wide Web. </li></ul><ul><li>In 2009 it became the first web server software to surpass the 100 million web site milestone. </li></ul><ul><li>Apache was the first viable alternative to the Netscape Communications Corporation web server (currently known as Sun Java System Web Server), and has since evolved to rival other Unix-based web servers in terms of functionality and performance. The majority of web servers using Apache run a Unix-like operating system.[citation needed] </li></ul>
  18. 18. Configuration ServerRoot : The top of the directory tree under which the server's configuration, error, and log files are kept. Example: ServerRoot &quot;/opt/lampp&quot; Listen : Allows you to bind Apache to specific IP addresses and/or ports, instead of the default. See also the <VirtualHost>directive. Example: Listen Listen 80
  19. 19. ServerAdmin : Your address, where problems with the server should be e-mailed. This address appears on some server-generated pages, such as error documents. e.g. [email_address] Example : ServerAdmin you@example.com
  20. 20. DocumentRoot : The directory out of which you will serve your documents. By default, all requests are taken from this directory, but symbolic links and aliases may be used to point to other locations. Example: DocumentRoot &quot;/opt/lampp/htdocs&quot;
  21. 21. User/Group : The name (or #number) of the user/group to run httpd as. It is usually good practice to create a dedicated user and group for running httpd, as with most system services. DirectoryIndex : sets the file that Apache will serve if a directory is requested. <IfModule dir_module> #DirectoryIndex index.html # XAMPP DirectoryIndex index.html index.html.var index.php index.php3 index.php4 </IfModule>
  22. 22. ErrorLog : The location of the error log file. If you do not specify an ErrorLog directive within a <VirtualHost> container, error messages relating to that virtual host will be logged here. If you *do* define an error logfile for a <VirtualHost> container, that host's errors will be logged there and not here. Example : ErrorLog logs/error_log LogLevel : Control the number of messages logged to the error_log. Possible values include: debug, info, notice, warn, error, crit, alert, emerg. Example : LogLevel warn
  23. 23. Installing Apache Three methods of installing Apache under Linux. The three methods are: • Binary installation • Using an RPM (Red Hat Package Manager) – recommended for people running Red Hat Linux • Building from source
  24. 24. Download the Software <ul><li>You can download Apache from the Apache Software Foundation web site located at http://www.apache.org, in source and binary forms. While your downloading Apache, you may want to browse over the documentation. </li></ul><ul><li>What you need: </li></ul><ul><li>To install Apache, you will need the following things: </li></ul><ul><li>1.A computer running Linux </li></ul><ul><li>2.Root access on this computer </li></ul><ul><li>3.For binary and source installations, the tar and gunzip Unix utilities </li></ul>
  25. 25. Binary Installation: A binary is pre-configured, which means someone else has gone to the trouble of configuring and building the software for you. There are, however, a few things you should keep in mind: • Binaries are compiled for a particular operating system. In other words, you must use a binary built specifically for FreeBSD on your FreeBSD machine and a Linux binary on your Linux machine. You need to be sure to grab the correct binary; if you don't see a binary for your particular operating system, you must choose a different method of installation. • Apache binaries are usually a version or two behind the current source distribution. This means you don't reap the benefits of the latest bug fixes and feature enhancements.
  26. 26. <ul><li>• Because binaries are pre-configured, you don't have much opportunity to alter the way the software works. If you're a newcomer, you may not care about this loss of flexibility.Fortunately most Apache binaries include a full source distribution, providing you with the best of both worlds -- play now, learn later. </li></ul><ul><li>Point your browser at http://www.apache.org/dist/httpd/binaries/ and </li></ul><ul><li>download the binary for your operating system (in our case, Linux). You'll most likely be presented with a directory containing multiple versions of Apache in various compressed forms. </li></ul>
  27. 27. <ul><li>RPM Installation </li></ul><ul><li>Those of you running Red Hat Linux may want to take advantage of Red Hat's RPM (&quot;RedHat Package Manager&quot;) system. </li></ul><ul><li>Almost identical to a binary, an RPM is further customized to play nicely with other RPMs and provide a consistent interface to installing, updating, and removingbinaries. </li></ul><ul><li>For Linux newcomers or when installing a small standard component, RPMs are simple and reliable. </li></ul><ul><li>Bear in mind that an Apache RPM may already be installed on your system depending on how Linux was originally installed on your computer. </li></ul><ul><li>To find out, at the shell prompt, type: </li></ul><ul><li>rpm -qa | grep apache </li></ul>
  28. 28. Basic commands: User Commands : Commands useful for users of a hadoop cluster. archive: Creates a hadoop archive. More information can be found at Hadoop Archives . Usage : hadoop archive -archiveName NAME <src>* <dest>
  29. 29. COMMAND_OPTION Description -archiveName NAME Name of the archive to be created. src Filesystem pathnames which work as usual with regular expressions. dest Destination directory which would contain the archive.
  30. 30. distcp : Copy file or directories recursively. More information can be found at Hadoop DistCp Guide . Usage: hadoop distcp <srcurl> <desturl> fs : Usage: hadoop fs [GENERIC_OPTIONS] [COMMAND_OPTIONS] Runs a generic filesystem user client. The various COMMAND_OPTIONS can be found at Hadoop FS Shell Guide.
  31. 31. jar Runs a jar file. Users can bundle their Map Reduce code in a jar file and execute it using this command. Usage: hadoop jar <jar> [mainClass] args... The streaming jobs are run via this command. Examples can be referred from Streaming examples Word count example is also run using jar command. It can be referred from Wordcount example fsck : Runs a HDFS filesystem checking utility. See Fsck for more info. Usage: hadoop fsck [ GENERIC_OPTIONS ] <path> [-move | -delete | -openforwrite] [-files [-blocks [-locations | -racks]]]
  32. 32. fsck : Runs a HDFS filesystem checking utility. Usage: hadoop fsck [ GENERIC_OPTIONS ] <path> [-move | -delete | -openforwrite] [-files [-blocks [-locations | -racks]]] COMMAND_OPTION Description <path> Start checking from this path. -move Move corrupted files to /lost+found -delete Delete corrupted files. -openforwrite Print out files opened for write. -files Print out files being checked. -blocks Print out block report. -locations Print out locations for every block. -racks Print out network topology for data-node locations.
  33. 33. job: COMMAND_OPTION Description -submit <job-file> Submits the job. -status <job-id> Prints the map and reduce completion percentage and all job counters. -counter <job-id> <group-name> <counter-name> Prints the counter value. -kill <job-id> Kills the job. -events <job-id> <from-event-#> <#-of-events> Prints the events' details received by jobtracker for the given range. -history [all] <jobOutputDir> -history <jobOutputDir> prints job details, failed and killed tip details. More details about the job such as successful tasks and task attempts made for each task can be viewed by specifying the [all] option. -list [all] -list all displays all jobs. -list displays only jobs which are yet to complete. -kill-task <task-id> Kills the task. Killed tasks are NOT counted against failed attempts. -fail-task <task-id> Fails the task. Failed tasks are counted against failed attempts.
  34. 34. Queue COMMAND_OPTION Description -list Gets list of Job Queues configured in the system. Along with scheduling information associated with the job queues. -info <job-queue-name> [-showJobs] Displays the job queue information and associated scheduling information of particular job queue. If -showJobs options is present a list of jobs submitted to the particular job queue is displayed.
  35. 35. <ul><li>Starting Apache: </li></ul><ul><li>Let's take your new Apache installation out for a spin. </li></ul><ul><li>f you installed Apache using a binary or from scratch, as root, type : </li></ul><ul><li>/usr/local/apache/bin/apachectl start </li></ul><ul><li>If you used an RPM, as root, type: </li></ul><ul><li>/sbin/service httpd start </li></ul><ul><li>Point your browser at your brand new Web server, http://localhost/. If everything worked you should see the default home page. </li></ul>
  36. 36. <ul><li>Customize: </li></ul><ul><li>Apache uses some rather easy to understand text files for </li></ul><ul><li>configuration. </li></ul><ul><li>On a Red Hat system,you'll find them in /etc/httpd/conf . </li></ul><ul><li>Quite a few Linux distributions place them in this same place,but if you can't find such a directory, do a search for &quot;httpd.conf&quot; . </li></ul><ul><li>Once you find these, you've found the main config files. If you're new to Linux, and need help finding this file, here's how you </li></ul><ul><li>can find it. </li></ul>
  37. 37. Now you should see where the file is located. When you move into the directory containing httpd.conf , you should see these three files: • httpd.conf – This has the settings for the overall configuration for the server. • access.conf – This file contains all the security settings for Apache. • srm.conf – This file contains the MIME definitions and default document names for files on the server.
  38. 38. <ul><li>Restarting Apache: </li></ul><ul><li>Whevever you make changes to the server configuration files, such as httpd.conf, they won't take effect until the server is restarted. </li></ul><ul><li>In Linux, Apache can be restarted depending on how you </li></ul><ul><li>installed it. </li></ul><ul><li>If you installed Apache using a binary or from scratch, as root, type: </li></ul><ul><li>/usr/local/apache/bin/apachectl start </li></ul><ul><li>If you used an RPM, as root, type: </li></ul><ul><li>/sbin/service httpd start </li></ul><ul><li>After being restarted the changes will have taken effect. </li></ul>
  39. 39. MYSQL
  40. 40. <ul><li>Mysql </li></ul><ul><li>MySQL is a relational database management system (RDBMS) that runs as a server providing multi-user access to a number of databases </li></ul><ul><li>The MySQL development project has made its source code available under the terms of the GNU General Public License , as well as under a variety of proprietary agreements. </li></ul><ul><li>MySQL is owned and sponsored by a single for-profit firm, the Swedish company MySQL AB , now owned by Sun Microsystems , a subsidiary of Oracle Corporation . </li></ul><ul><li>Members of the MySQL community have created several forks such as Drizzle and MariaDB . Both forks were in progress before the Oracle acquisition (Drizzle was announced 8 months before the Sun acquisition). </li></ul>
  41. 41. Installing MySQL on Linux It's simple to install MySQL on Linux using the RPM file. 1. Become the superuser if you are working in your account. (Type &quot;su&quot; and the prompt and give the root password). 2. Change to the directory that has the RPM download. 3. Type the following command at the prompt: rpm -ivh &quot;mysql_file_name.rpm&quot; Similarly you can also install the MySQL client and MySQL development RPMs if you've downloaded them. Alternatively, you can install the RPMs through GnoRPM (found under System). 4. Now we'll set a password for the root user. Issue the following at the prompt. mysqladmin -u root password mysqldata where mysqldata is the password for the root. (Change this to anything you like).
  42. 42. <ul><li>5. It is now time to test the programs. Typing the following at the prompt starts the mysql client program. </li></ul><ul><li>mysql -u root -p </li></ul><ul><li>The system asks for the the password. Type the root password (mysqldata). </li></ul><ul><li>If you don't get the prompt for password, it might be because MySQL Server is not running. To start the server, change to /etc/rc.d/init.d/ directory and issue the command ./mysql start (or mysql start depending on the value of the PATH variable on your system). Now invoke mysql client program. </li></ul><ul><li>6. Once MySQL client is running, you should get the mysql> prompt. Type the following at this prompt: </li></ul><ul><li>show databases; </li></ul>
  43. 43. 7. You should now get a display similar to: +----------------+ | Database | +----------------+ | mysql | | test | +----------------+ 2 rows in set (0.00 sec)
  44. 44. Configuration <ul><li>The MySQL server configuration normally started during installation process . </li></ul><ul><li>MySQL server configuration wizard window </li></ul><ul><li>The MySQL configuration wizard can be launched by clicking the MySQL server instance configuration wizard entry in the MySQL section of the window start menu. </li></ul><ul><li>Another way to launch the configuration wizard, you can launch the MySQLInstanceConfig.exe file directly from bin directory of your MySQL installation. </li></ul><ul><li>The MySQL server configuration wizard sets configuration variables values in my.ini file in the installation directory for the MySQL server. </li></ul><ul><li>--defaults-file=&quot;C:Program FilesMySQLMySQL Server 5.0my.ini&quot; </li></ul>
  45. 45. <ul><li>Path &quot;C:Program FilesMySQLMySQL Server 5.0&quot; is  installation directory of MySQL server . </li></ul><ul><li>The --defaults-file option instructs the MySQL server to read the specified file for configuration options when it starts.  </li></ul><ul><li>The MySQL client and utilities like mysql and mysqldump command-line client are unable to locate the my.ini file locate in the server installation directory. </li></ul><ul><li>The MySQL use window server 2003, window server 2000 and window XP, MySQL server configuration wizard will configure MySQL to work as a windows services. </li></ul>
  46. 46. <ul><li>The MySQL Server configuration wizard on Linux: </li></ul><ul><li>If you want to install the MySQL server configuration on Linux then you have to run the mysqlsetup command. </li></ul><ul><li>For displaying MySQL server configuration wizard interface on a different machine, then you have to set the value of the DISPLAY variable on the command line.  </li></ul><ul><li>Example: </li></ul><ul><li>shell> </li></ul><ul><li>DISPLAY=remote:0.0 mysqlsetup    </li></ul>
  47. 47. <ul><li>Basic commands: </li></ul><ul><li>To login (from unix shell) use -h only if needed. </li></ul><ul><li># [mysql dir]/bin/mysql -h hostname -u root -p </li></ul><ul><li>Create a database on the sql server. </li></ul><ul><li>mysql> create database [databasename]; </li></ul><ul><li>List all databases on the sql server. </li></ul><ul><li>mysql> show databases; </li></ul><ul><li>Switch to a database. </li></ul><ul><li>mysql> use [db name]; </li></ul>
  48. 48. <ul><li>To see all the tables in the db. </li></ul><ul><li>mysql> show tables; </li></ul><ul><li>To see database's field formats. </li></ul><ul><li>mysql> describe [table name]; </li></ul><ul><li>To delete a db. </li></ul><ul><li>mysql> drop database [database name]; </li></ul><ul><li>To delete a table. </li></ul><ul><li>mysql> drop table [table name]; </li></ul>
  49. 49. <ul><li>Show all data in a table. </li></ul><ul><li>mysql> SELECT * FROM [table name]; </li></ul><ul><li>Returns the columns and column information pertaining to the designated table. </li></ul><ul><li>mysql> show columns from [table name]; </li></ul><ul><li>Show certain selected rows with the value &quot;whatever&quot;. </li></ul><ul><li>mysql> SELECT * FROM [table name] WHERE [field name] = &quot;whatever&quot;; </li></ul><ul><li>Show all records containing the name &quot;Bob&quot; AND the phone number '3444444'. </li></ul><ul><li>mysql> SELECT * FROM [table name] WHERE name = &quot;Bob&quot; AND phone_number = '3444444'; </li></ul>
  50. 50. <ul><li>Show unique records. </li></ul><ul><li>mysql> SELECT DISTINCT [column name] FROM [table name]; </li></ul><ul><li>Show selected records sorted in an ascending (asc) or descending (desc). </li></ul><ul><li>mysql> SELECT [col1],[col2] FROM [table name] ORDER BY [col2] DESC; </li></ul><ul><li>Return number of rows. </li></ul><ul><li>mysql> SELECT COUNT(*) FROM [table name]; </li></ul><ul><li>Sum column. </li></ul><ul><li>mysql> SELECT SUM(*) FROM [table name]; </li></ul>
  51. 51. <ul><li>Creating a new user. Login as root. Switch to the MySQL db. Make the user. Update privs. </li></ul><ul><li># mysql -u root -p </li></ul><ul><li>mysql> use mysql; </li></ul><ul><li>mysql> INSERT INTO user (Host,User,Password) VALUES('%','username',PASSWORD('password')); </li></ul><ul><li>mysql> flush privileges; </li></ul><ul><li>Change a users password from unix shell. </li></ul><ul><li># [mysql dir]/bin/mysqladmin -u username -h hostname.blah.org -p password 'new-password' </li></ul>
  52. 52. <ul><li>Recover a MySQL root password. Stop the MySQL server process. Start again with no grant tables. Login to MySQL as root. Set new password. Exit MySQL and restart MySQL server. </li></ul><ul><li># /etc/init.d/mysql stop </li></ul><ul><li># mysqld_safe --skip-grant-tables & </li></ul><ul><li># mysql -u root </li></ul><ul><li>mysql> use mysql; </li></ul><ul><li>mysql> update user set password=PASSWORD(&quot;newrootpassword&quot;) where User='root'; </li></ul><ul><li>mysql> flush privileges; </li></ul><ul><li>mysql> quit </li></ul><ul><li># /etc /init.d/mysql stop </li></ul><ul><li># /etc/init.d/mysql start </li></ul>
  53. 53. <ul><li>Create Table Example 1. </li></ul><ul><li>mysql > CREATE TABLE [table name] (firstname VARCHAR(20), middleinitial VARCHAR(3), lastname VARCHAR(35),suffix VARCHAR(3),officeid VARCHAR(10),userid VARCHAR(15),username VARCHAR(8),email VARCHAR(35),phone VARCHAR(25), groups VARCHAR(15),datestamp DATE,timestamp time,pgpemail VARCHAR(255)); </li></ul><ul><li>Delete a row(s) from a table. </li></ul><ul><li>mysql> DELETE from [table name] where [field name] = 'whatever'; </li></ul><ul><li>Update database permissions/privilages. </li></ul><ul><li>mysql> flush privileges; </li></ul>
  54. 54. <ul><li>Delete a column. </li></ul><ul><li>mysql> alter table [table name] drop column [column name]; </li></ul><ul><li>Add a new column to db. </li></ul><ul><li>mysql> alter table [table name] add column [new column name] varchar (20); </li></ul><ul><li>Change column name. </li></ul><ul><li>mysql> alter table [table name] change [old column name] [new column name] varchar (50); </li></ul><ul><li>Delete unique from table. </li></ul><ul><li>mysql> alter table [table name] drop index [colmn name]; </li></ul>
  55. 55. <ul><li>Setting up the mySQL Database: </li></ul><ul><li>First , it doesn't matter what your own computer operating system is; what matters is what is running on the server where you wish to install your software. </li></ul><ul><li>Secondly , mySQL must be installed and the database for your blog created prior to installing the software. </li></ul><ul><li>if you're using commercial web hosting , then your host will likely have set up a database for you and can provide the username, password and database name to input into the wp-config.php file ; if so, skip the next section. </li></ul><ul><li>Creating the Database Yourself. if you're trying to install software on your own server or virtual private server (with mySQL already installed), you'll need to create the database for your blog first; this can be done via SSH by logging in and going to the mysql prompt. </li></ul>
  56. 56. <ul><li>If you have not logged in as root, the first two lines below will allow you to switch to root; if you did log in as root, then go straight into mysql: </li></ul><ul><li>% mysql -u root -p </li></ul><ul><li>% pwd typerootpasswordhere </li></ul><ul><li>mysql> CREATE DATABASE newdatabasename; </li></ul><ul><li>=> </li></ul>
  57. 57. <ul><li>If you have not logged in as root, the first two lines below will allow you to switch to root; if you did log in as root, then go straight into mysql: </li></ul><ul><li>% mysql -u root -p </li></ul><ul><li>% pwd typerootpasswordhere </li></ul><ul><li>mysql> CREATE DATABASE newdatabasename; </li></ul><ul><li>=> Don't skip the semicolon at the end. THIS is where you can make up a name for the database. Personally, I would call it something other than &quot;wordpress&quot; simply to differentiate between that and every other mention of wordpress. Every little bit helps. ;-) </li></ul><ul><li>Next, you need to set the username and password for the new database: </li></ul><ul><li>mysql> GRANT ALL </li></ul><ul><li>-> ON databasename.* </li></ul><ul><li>-> TO 'newusername'@'localhost' </li></ul><ul><li>-> IDENTIFIED BY 'newpassword'; </li></ul>
  58. 58. <ul><li>and hit &quot;Enter&quot; -- you should get a &quot;Query OK&quot; or similar response from mysql. Note: you may not want to grant &quot;all&quot; privileges to a user. See Creating Users and Setting Permissions in MySQL . </li></ul><ul><li>Also, a list of mySQL privileges gives us this: </li></ul><ul><li>Insert - Create tables </li></ul><ul><li>Update - table </li></ul><ul><li>Delete - table </li></ul><ul><li>Index - Used to create or remove indexes for tables. </li></ul><ul><li>Alter - Used for tables, allows the use of the &quot;ALTER TABLE&quot; command. </li></ul><ul><li>Create - Make new database, table, or index. </li></ul><ul><li>Drop - Remove database or table. </li></ul><ul><li>Grant - Allows a user to give other users the privilege that they have. Used to grant access to databases or tables </li></ul>
  59. 59. <ul><li>References - Database or table. </li></ul><ul><li>Reload - Have the database engine re-read the grant tables. </li></ul><ul><li>Shutdown </li></ul><ul><li>Process </li></ul><ul><li>File - Can read and write files on the SQL server using &quot;SELECT...INTO OUTFILE&quot; or &quot;LOAD DATA INFILE&quot;. </li></ul><ul><li>Last, to make the new privileges &quot;take&quot;: </li></ul><ul><li>mysql> flush privileges; </li></ul>
  60. 60. PHP
  61. 61. Php <ul><li>PHP: Hypertext Preprocessor is a widely used, general-purpose scripting language that was originally designed for web development to produce dynamic web pages. </li></ul><ul><li>For this purpose, PHP code is embedded into the HTML source document and interpreted by a web server with a PHP processor module, which generates the web page document. As a general-purpose programming language , PHP code is processed by an interpreter application in command-line mode performing desired operating system operations and producing program output on its standard output channel. </li></ul><ul><li>It may also function as a graphical application. PHP is available as a processor for most modern web servers and as standalone interpreter on most operating systems and computing platforms. </li></ul>
  62. 62. <ul><li>Installing PHP: </li></ul><ul><li>First, extract the PHP package ( php-4.3.10-Win32.zip ). I extracted the package in the directory where Apache was installed ( C:Program FilesApache GroupApache2 ). </li></ul><ul><li>Change the new created directory name to php ( just to make it shorter ). Then copy the file php.ini-dist in PHP directory to you windows directory ( C:Windows or C:Winnt depends on where you installed Windows ) and rename the file to php.ini. </li></ul><ul><li>Next, move the php4ts.dll file from the newly created php directory into the sapi subdirectory. </li></ul>
  63. 63. <ul><li>Quoting from php installation file you can also place php4ts.dll in other places such as : </li></ul><ul><li>1.In the directory where apache.exe is start from ( C:Program FilesApache GroupApache2 in) </li></ul><ul><li>2.In your %SYSTEMROOT%System32, %SYSTEMROOT%system and %SYSTEMROOT% directory. </li></ul><ul><li>3. Note: %SYSTEMROOT%System32 only applies to Windows NT/2000/XP) </li></ul><ul><li>4.In your whole %PATH% </li></ul>
  64. 64. <ul><li>configuration: </li></ul><ul><li>About php.ini : </li></ul><ul><li>PHP's initialization file, generally called php.ini , is responsible for </li></ul><ul><li>configuring many of the aspects of PHP's behavior. </li></ul><ul><li>PHP attempts to find and load this configuration from a number of locations. </li></ul><ul><li>The following is a summary of its search order: </li></ul><ul><li>1. SAPI module specific location. </li></ul><ul><li>2. The PHPRC environment variable. (As of PHP 5.2.0) </li></ul><ul><li>3. A number of predefined registry keys on Windows (As of PHP 5.2.0) </li></ul><ul><li>4. Current working directory ( except CLI ) </li></ul><ul><li>5. The web server's directory , or directory of PHP </li></ul><ul><li>6. The directory from the --with-config-file-path compile time option, or the </li></ul><ul><li>Windows directory (C:windows or C:winnt) </li></ul><ul><li>See the PHP docs for more specific information. </li></ul><ul><li>http://php.net/configuration.file </li></ul>
  65. 65. <ul><li>After installing PHP, the next step would be configuring its many options. </li></ul><ul><li>In order to do this, you must edit the configuration file, which should be called &quot;php.ini &quot;. </li></ul><ul><li>PHP reads this file when it starts, so you shouldn't expect your changes to apply as soon as you've modified the file, you have to restart the web - server after you've changed PHP's configuration file! </li></ul><ul><li>The configuration file is not provided with PHP; instead, there are two templates which should help you decide on PHP settings: a development purposes template &quot; php.ini-dist &quot; – and a production site template &quot; php.ini - recommended&quot; . </li></ul><ul><li>If no configuration file is used, then PHP will use the factory settings. </li></ul>
  66. 66. <ul><li>If you intend to use PHP for learning and development, you should definitely use the first template . </li></ul><ul><li>If you will use PHP for production purposes, you should go with the second template. </li></ul><ul><li>This second one makes PHP more efficient and more secure. Unfortunately, this way of improving PHP's performance may make it incompatible with some applications, and may prove to be difficult to develop with. </li></ul><ul><li>So go ahead and choose the one it suits you best, and then copy it under the name &quot; php.ini &quot; in its intended location – you can find out where PHP looks for its configuration file if you read the documentation. </li></ul><ul><li>The locations of the configuration file may differ for each platform, so, for example, on UNIX-systems you should place it in &quot;/usr/local/lib/&quot; . </li></ul><ul><li>A &quot;php.ini&quot; file in the current working directory will override one in the default location, so it's easy to change the behavior of PHP on a per-directory basis. </li></ul>
  67. 67. <ul><li>The configuration file is fully commented, so you can go over each one setting and see the effect on your application, and then decide weather to modify it or not. </li></ul><ul><li>Changing the values is actually very easy, you just have to open the configuration file in your favorite text file editor, and simply modify the settings according to your needs. </li></ul><ul><li>Again, remember to restart the web-server after you've altered the configuration file. </li></ul><ul><li>White spaces between these two are ignored; a semicolon instructs PHP not to take into consideration the text that follows the semicolon, until the end of the line. Most settings' names are suggestive to their behavior, and you will find some useful descriptions before each setting. </li></ul>
  68. 68. AJAX
  69. 69. AJAX 1. AJAX stands for Asynchronous JavaScript And XML. 2. AJAX is not a new programming language, but a new way to use existing standards. 3. With AJAX you can create better, faster, and more user-friendly web applications. 4. AJAX is based on JavaScript and HTTP requests.
  70. 70. 5. With AJAX, your JavaScript can communicate directly with the server, using the JavaScript XMLHttpRequest object. With this object, your JavaScript can trade data with a web server, without reloading the page. 6. AJAX uses asynchronous data transfer (HTTP requests) between the browser and the web server, allowing web pages to request small bits of information from the server instead of whole pages. AJAX is based on the following web standards: 1. JavaScript 2. XML 3. HTML 4. CSS
  71. 71. <ul><li>The web standards used in AJAX are well defined, and supported by all major browsers. AJAX applications are browser and platform independent. </li></ul><ul><li>AJAX is About Better Internet Applications: </li></ul><ul><li>Web applications have many benefits over desktop applications; they can reach a larger audience, they are easier to install and support, and easier to develop.However, Internet applications are not always as “rich” and user-friendly as traditional desktop applications. </li></ul><ul><li>With AJAX, Internet applications can be made richer and more user-friendly. </li></ul><ul><li>   </li></ul>
  72. 72. 1. Because the server returns a new page each time the user submits input, traditional web applications can run slowly and tend to be less user-friendly.    2. With an HTTP request, a web page can make a request to, and get a response from a web server – without reloading the page. The user will stay on the same page, and he or she will not notice that scripts request pages, or send data to a server in the background.
  73. 73. <ul><li>The XMLHttpRequest Object: </li></ul><ul><li>By using the XMLHttpRequest object, a web developer can update a page with data from the server after the page has loaded! </li></ul><ul><li>Example : Google Suggest is using the XMLHttpRequest object to create a very dynamic web interface: When you start typing in Google’s search box, a JavaScript sends the letters off to a server and the server returns a list of suggestions. </li></ul><ul><li>The XMLHttpRequest object is supported in Internet Explorer 5.0+, Safari 1.2, Mozilla 1.0 / Firefox, Opera 8+, and Netscape 7. </li></ul>
  74. 74. AJAX Suggest example The following AJAX example will demonstrate how a web page can communicate with a web server while a user enters data into an HTML form. Type a name in the input field below: First name: Suggestions: Example explained – The HTML form The form above has the following HTML code: <form> First Name: <input /> </form> <p>Suggestions: <span></span></p>
  75. 75. AJAX – Browser support The keystone of AJAX is the XMLHttpRequest object. All new browsers use the built-in JavaScript XMLHttpRequest object to create an XMLHttpRequest object (IE5 and IE6 uses an ActiveXObject). Let’s update our ” txt1.htm” file with a JavaScript that creates an XMLHttpRequest object: <html> <body> <script> function ajaxFunction() { var xmlhttp; if (window.XMLHttpRequest)   {   // code for IE7+, Firefox, Chrome, Opera, Safari
  76. 76. xmlhttp=new XMLHttpRequest();   } else if (window.ActiveXObject)   {   // code for IE6, IE5   xmlhttp=new ActiveXObject(”Microsoft.XMLHTTP”);   } else   {   alert(”Your browser does not support XMLHTTP!”);   } } </script> <form> Name: <input /> Time: <input /> </form> </body> </html>
  77. 77. The AJAX HTML page This is the HTML page. It contains a simple HTML form and a link to a JavaScript. <html> <head> <script src=”clienthint.js”></script> </head> <body> <form> First Name: <input /> </form> <p>Suggestions: <span></span></p> </body> </html>
  78. 78. Installation To install AJAX Control Toolkit, first of all download it from the links provided in the previous article  ASP.Net AJAX Control Toolkit . Now after downloading the zip file, follow these steps: 1.Create a folder AJAX Control Toolkit at path  C:Program FilesMicrosoft ASP.NETASP.NET 2.0 AJAX Extensions  or the drive where you have installed the Windows on PC. 2.Then extract the files of downloaded Control Toolkit .zip inside new created folder. 3.You will get the following folders and files from the extracted items: -> AjaxControlExtender -> AjaxControlToolkit -> Binaries -> SampleWebSite
  79. 79. -> TemplateVSI -> ToolkitTests -> AjaxControlToolkit.sln [Visual Studio Solution file] 4.Double click on  AjaxControlToolkit.sln solution file  to open it in Visual Studio 2005. It will show a security warning with two project load options: -> Load project for browsing -> Load project normally 5.Select load project normally and click ok.
  80. 80. 6. After loading the solution it will display  AJAXControlToolkit , SampleWebSite ,  ToolKitTests ,  TemplateVSI  in the solution explorer. Right click on TemplateVSI and click build. After successful compile and build go to the path X: or  C:Program FilesMicrosoft ASP.NETASP.NET 2.0 AJAX ExtensionsAJAX Control ToolkitTemplateVSIin  At this path you will get the fresh build of AjaxControlExtender.vsi 7. Next Right click on  SampleWebSite  in the solution explorer and Build Web Site to get the fresh copy of  AjaxControlToolkit.dll . You will get the fresh AjaxControlToolkit.dll at : X: or  C:Program FilesMicrosoft ASP.NETASP.NET 2.0 AJAX ExtensionsAJAX Control ToolkitSampleWebSiteBin
  81. 81. 8. Now you are ready to add the Control Toolkit in your Visual Studio 2005. First of all go to TemplateVSI bin folder discussed in step 6 and run AjaxControlExtender.vsi.  This installer will install the ASP.Net web template that will enable you to create AJAX Control Toolkit Web Site. 9. After installing  AjaxControlExtender.vsi , open the Visual Studio 2005 and go for New Web Site, there you will see a new My Template item as AJAX Control Toolkit Web Site, select it and create a new website.  
  82. 82. HTML
  83. 83. HTML <ul><li>HTML, which stands for HyperText Markup Language, is the predominant markup language for web pages. </li></ul><ul><li>It allows images and objects to be embedded and can be used to create interactive forms. It is written in the form of HTML elements consisting of &quot;tags&quot; surrounded by angle brackets within the web page content. It can embed scripts in languages such as JavaScript which affect the behavior of HTML webpages. </li></ul><ul><li>HTML can also be used to include Cascading Style Sheets (CSS) to define the appearance and layout of text and other material. </li></ul><ul><li>The W3C, maintainer of both HTML and CSS standards, encourages the use of CSS over explicit presentational markup. </li></ul>
  84. 84. HTML Headings <ul><li>A heading in HTML is just what you might expect, a title or subtitle. </li></ul><ul><li>By placing text inside of <h1> (heading) tags, the text displays bold and the size of the text depends on the number of heading (1-6). </li></ul><ul><li>Headings are numbered 1-6, with 1 being the largest heading and 6 being the smallest. </li></ul>
  85. 85. HTML Paragraphs <ul><li>The <p> tag defines a paragraph. </li></ul><ul><li>Using this tag places a blank line above and below the text of the paragraph. </li></ul><ul><li>These automated blank lines are examples of how a tag &quot;marks&quot; a paragraph and the web browser automatically understands how to display the paragraph text because of the paragraph tag. </li></ul>
  86. 86. HTML Text Formatting <ul><li>As you begin to place more and more elements onto your web site, it will become necessary to make minor changes to the formatting of those elements. </li></ul><ul><li>In our HTML Attributes lesson we discussed ways to add some flavor with attributes and align elements within other elements. </li></ul><ul><li>Several tags exist to further amplify text elements. These formatting tags can make text bold, italic, sub/superscripted, and more. </li></ul>
  87. 87. HTML Images <ul><li>Images are a staple of any web designer, so it is very important that you understand how to use them properly. </li></ul><ul><li>Use the <img /> tag to place an image on your web page. </li></ul><ul><li>HTML Code: </li></ul><ul><li><img src=&quot;sunset.gif&quot; /> </li></ul>
  88. 88. HTML Tables <ul><li>Tables may seem difficult at first, but after working through this lesson you'll see how they aren't too bad. </li></ul><ul><li>The <table> tag is used to begin a table. Within a table element are the <tr> (table rows) and <td> (table columns) tags. </li></ul><ul><li>Tables are a handy way to create a site's layout, but it does take some getting used to. Here's how to make a table. </li></ul><ul><li>HTML Code: </li></ul><ul><li><table border=&quot;1&quot;> </li></ul><ul><li><tr><td>Row 1 Cell 1</td><td>Row 1 Cell 2</td></tr> </li></ul><ul><li><tr><td>Row 2 Cell 1</td><td>Row 2 Cell 2</td></tr> </li></ul><ul><li></table> </li></ul>
  89. 89. HTML Forms <ul><li>Forms are a vital tool for the webmaster to receive information from the web surfer, such as: their name, email address, credit card, etc. </li></ul><ul><li>A form will take input from the viewer and depending on your needs, you may store that data into a file, place an order, gather user statistics, register the person to your web forum, or maybe subscribe them to your weekly newsletter. </li></ul><ul><li>HTML Code: </li></ul><ul><li><form method=&quot;post&quot; action=&quot;mailto:youremail@email.com&quot;> </li></ul><ul><li>Name: <input type=&quot;text&quot; size=&quot;10&quot; maxlength=&quot;40&quot; name=&quot;name&quot;> <br /> </li></ul><ul><li>Password: <input type=&quot;password&quot; size=&quot;10&quot; maxlength=&quot;10&quot; name=&quot;password&quot;> </li></ul><ul><li></form> </li></ul>
  90. 90. HTML Attributes <ul><li>Attributes are used to amplify tags. What we mean by amplify is that when a web browser interprets a tag, it will also search for set attributes and then display the element (tags+attributes) in its entirety. </li></ul><ul><li>At some point you may want to give your body element a background color or perhaps change the width of a table. All of these things and more can be achieved using Attributes. </li></ul>
  91. 91. HTML - Class or ID Attribute <ul><li>The class and id attributes are nearly identical. </li></ul><ul><li>They play no direct role in formatting your elements but rather serve behind the scenes for scripting and Cascading Style Sheets (CSS). </li></ul><ul><li>The role of classification and identifying elements will become more apparent as your learn CSS. </li></ul><ul><li>The idea is that you can classify or id certain a tag and later format the tag using Cascading Style Sheets. </li></ul><ul><li>It becomes necessary when you have two or more of the same element on a page (like a <p> tag) but want them to be different in appearance. </li></ul>
  92. 92. Example HTML Code: <p id=&quot;italicsparagraph&quot;>Paragraph type 1 Italics</p> <p id=&quot;boldparagraph&quot;>Paragraph type 2 Bold</p> Classification Attributes: Paragraph type 1 Italics Paragraph type 2 Bold
  93. 93. HTML - Name Attribute <ul><li>Name is much different than id and class. By allotting a name to an element, that name becomes a scripting variable for scripting languages such as Javascript, ASP, and PHP. </li></ul><ul><li>The name attribute is seen most often with forms and other user-input elements. </li></ul><ul><li>HTML Code: </li></ul><ul><li><input type=&quot;text&quot; name=&quot;TextField&quot; /> </li></ul><ul><li>This attribute has no effect on the display of the text field, but behind the scenes it plays a huge identification role. </li></ul>
  94. 94. HTML - Title Attribute <ul><li>This attribute titles an element and adds a tiny text pop-up to any HTML element. Much like the text pop-ups of word processing programs, these attributes should not be forgotten. </li></ul><ul><li>You may title an element anything you would like, the effects of this attribute are not seen until you hover your mouse over the element for a few seconds. </li></ul><ul><li>HTML Code: </li></ul><ul><li><h2 title=&quot;Hello There!&quot;>Titled Heading Tag</h2> </li></ul><ul><li>Title Attribute: </li></ul><ul><li>Titled Heading Tag </li></ul>
  95. 95. HTML Colors <ul><li>Color Values </li></ul><ul><li>HTML colors are defined using a hexadecimal (hex) notation for the combination of Red, Green, and Blue color values (RGB). </li></ul><ul><li>The lowest value that can be given to one of the light sources is 0 (hex 00). The highest value is 255 (hex FF). </li></ul><ul><li>Hex values are written as 3 double digit numbers, starting with a # sign. </li></ul>
  96. 96. HTML basic commands A Very Simple Web Page Here is a small bit of HTML code that will produce a web page. <html> <head> <title>Basic HTML page</title> </head> <body> <h1>Basic HTML Page</h1> <p>This is a line of regular text.</p> <hr> <p>This is a line of regular text below a horizontal rule.</p> </body> </html>
  97. 97. Basic Commands Document Structure <html> </html> HTML documents begin at the first tag and end at the second. These tags tell the browser that what lies between is coded in HTML. <head> </head> Header i nformation goes between these tags. The <title> tags are used to create a title that appears at the top of the browser window. The <meta> tag can be used to help webcrawlers index your site. <body> </body> The contents of the main page are displayed between these tags. You can set various attributes within this tag, including background images and colors and colors for text and links.
  98. 98. Body tags <h3>  </h3>   Medium-sized header line H1 gives the biggest, h6 gives the smallest. Try them out to see which suits any given application. Within this tag, the attribute align= can be set to left, center, or right. For example: <h3 align=&quot;center&quot;>  </h3>  centers the header. <p>  Starts a new paragraph: a blank line followed by a new line. You should use the </p> tag to end the paragraph, but it isn't necessary. <br>    or    <br /> Starts a new line without a blank line in between. <b>  </b>  Bold face any text between the tags. <i>  </i>  Italic face any text between the tags. <u>  </u>  Underline any text between the tags. Not widely used, because most underlined text on HTML pages is hyperlinks
  99. 99. Basic commands: <sup>  </sup>   Superscript any text between the tags. <sub>  </sub>   Subscript any text between the tags. <tt>  </tt>  Any text between the tags is uniformly spaced: good for aligning columns. <hr> Draws a horizontal line. The attribute size=&quot;50%&quot; (any percent will do) draws a line of that percentage of the screen width. The attribute align= can be used to move the line to left, center, or right.   Image, Link, and Comment tags <img src=&quot;filename&quot; alt=&quot;text&quot;> Insert the image file: .jpg, .gif, or .png files are supported by nearly all browsers. The alt tag prints out some text (like the name of the picture) if the web browsercan't display the image for some reason. The alt text is displayed by the &quot;tool tips&quot; function of the browser.
  100. 100. Basic commands: h1 align=&quot;center&quot;><img src=&quot;filename&quot; alt=&quot;text&quot;></h1> A little trick to get a centered image: enclose the image inside headline tags, with the align=&quot;center&quot; attribute. <a href=&quot;filename&quot;> Highlighted text </a> Creates a link to the listed file. This can be a path to a file located on the server, or it can be a link to a file on another computer. In the latter case, the file name should start out with &quot;http://&quot;. Instead of the text you can put an <img src=&quot;whatever&quot;> to get a clickable image as a link. This is a common way to putting in buttons. <a href=&quot;filename&quot; target=&quot;_blank&quot;> Highlighted text </a> The target=&quot;_blank&quot; attribute creates a NEW browser window containing the linked HTML file. Note that the default behavior of an <a href=> tag, if you don't include a &quot;target=&quot; attribute, is to replace the current web page with the new one.
  101. 101. Css
  102. 102. What is CSS? * CSS stands for Cascading Style Sheets * Styles define how to display HTML elements * Styles were added to HTML 4.0 to solve a problem * External Style Sheets can save a lot of work * External Style Sheets are stored in CSS files
  103. 103. CSS Syntax <ul><li>A CSS rule has two main parts: a selector, and one or more declarations: </li></ul><ul><li>h1{colour:blue;font-size:12px;} </li></ul><ul><li>Where, , h1=selector, </li></ul><ul><li>Color & font-size=property, </li></ul><ul><li>Blue & 12px=value </li></ul><ul><li>The selector is normally the HTML element you want to style </li></ul><ul><li>Each declaration consists of a property and a value. </li></ul><ul><li>The property is the style attribute you want to change. </li></ul><ul><li>Each property has a value. </li></ul>
  104. 104. CSS Id and Class <ul><li>The id and class Selectors </li></ul><ul><li>In addition to setting a style for a HTML element, CSS allows you to specify your own selectors called &quot;id&quot; and &quot;class&quot;. </li></ul>
  105. 105. The id Selector <ul><li>The id selector is used to specify a style for a single, unique element. </li></ul><ul><li>The id selector uses the id attribute of the HTML element, and is defined with a &quot;#&quot;. </li></ul><ul><li>The style rule below will be applied to the element with id=&quot;para1&quot;: </li></ul><ul><li>Example </li></ul><ul><li>#para1 </li></ul><ul><li>{ </li></ul><ul><li>text-align:center; </li></ul><ul><li>color:red; </li></ul><ul><li>} </li></ul>
  106. 106. The class Selector <ul><li>The class selector is used to specify a style for a group of elements. Unlike the id selector, the class selector is most often used on several elements. </li></ul><ul><li>This allows you to set a particular style for any HTML elements with the same class. </li></ul><ul><li>The class selector uses the HTML class attribute, and is defined with a &quot;.&quot; </li></ul><ul><li>In the example below, all HTML elements with class=&quot;center&quot; will be center-aligned: </li></ul><ul><li>Example </li></ul><ul><li>.center {text-align:center;} </li></ul>
  107. 107. Three Ways to Insert CSS There are three ways of inserting a style sheet: * External style sheet * Internal style sheet * Inline style
  108. 108. External Style Sheet <ul><li>An external style sheet is ideal when the style is applied to many pages. </li></ul><ul><li>With an external style sheet, you can change the look of an entire Web site by changing one file. </li></ul><ul><li>Each page must link to the style sheet using the <link> tag. The <link> tag goes inside the head section: </li></ul><ul><li><head> </li></ul><ul><li><link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;mystyle.css&quot; /> </li></ul><ul><li></head> </li></ul>
  109. 109. Internal Style Sheet <ul><li>An internal style sheet should be used when a single document has a unique style. </li></ul><ul><li>You define internal styles in the head section of an HTML page, by using the <style> tag, like this: </li></ul><ul><li><head> </li></ul><ul><li><style type=&quot;text/css&quot;> </li></ul><ul><li>hr {color:sienna;} </li></ul><ul><li>p {margin-left:20px;} </li></ul><ul><li>body {background-image:url(&quot;images/back40.gif&quot;);} </li></ul><ul><li></style> </li></ul><ul><li></head> </li></ul>
  110. 110. CSS Box Model <ul><li>All HTML elements can be considered as boxes. In CSS, the term &quot;box model&quot; is used when talking about design and layout. </li></ul><ul><li>The CSS box model is essentially a box that wraps around HTML elements, and it consists of: margins, borders, padding, and the actual content. </li></ul><ul><li>The box model allows us to place a border around elements and space elements in relation to other elements. </li></ul>
  111. 111. different parts: * Margin - Clears an area around the border. The margin does not have a background color, and it is completely transparent * Border - A border that lies around the padding and content. The border is affected by the background color of the box * Padding - Clears an area around the content. The padding is affected by the background color of the box * Content - The content of the box, where text and images appear
  112. 112. CSS Styling <ul><li>Background Color </li></ul><ul><li>The background-color property specifies the background color of an element. </li></ul><ul><li>The background color of a page is defined in the body selector: </li></ul><ul><li>Example </li></ul><ul><li>body {background-color:#b0c4de;} </li></ul>
  113. 113. Sources: CSS information can be provided by various sources. CSS style information can be either attached as a separate document or embedded in the HTML document. * Author styles : inline styles, inside the HTML document, style information on a single element, specified using the &quot;style&quot; attribute. *User style: a local CSS-file specified by the user using options in the web browser, and acting as an override, to be applied to all documents. *User agent style :the default style sheet applied by the user agent, e.g. the browser's default presentation of elements. File highlightheaders.css containing: h1 { color: white; background-color: orange !important; } h2 { color: white; background-color: green !important; }
  114. 114. Text-decoration: The text-decoration property specifies how text is decorated. Possible values are: * underline: adds an underline to the text * overline: adds a line on top of the text * line-through: adds a line through the middle of the text. * blink: causes the text to blink . p {text-decoration:underline;} An underline example p {ext-decoration:overline;} An overline example p {text-decoration:line-through;} A strikethrough (line-through) example
  115. 115. Word spacing The word-spacing property controls the amount of space between words. For example, with a CSS declaration of, p { word-spacing:5px; } The following HTML, <p>Words here are separated by 5px.</p> renders Words here are separated by 5px.
  116. 116. FLOAT: One of the commonly-seen layout, especially in large websites displaying ads, is wrapping the text around an advertising block. This is accomplished using the float property. The float property has three possible values: 'left', 'right', and 'none'. Let's take a look at the following examples: Example 1: Given the CSS declaration, #leftfloat { float:left; } And it should be followed by html codes: <span id=&quot;leftfloat&quot;><img src=&quot;yp.jpg&quot;></span>This example illustrates how float:left affects the appearance of a block. Notice how the image &quot;floats&quot; to the left. This example illustrates how float: left affects the appearance of a block. Notice how the image &quot; floats&quot; to the left.
  117. 117. Color property: The color property allows webmasters to define the color of an element in a CSS stylesheet. This property takes values in 3 forms: *Hexadecimal code *RGB *Color name Hexadecimal code: {color:#XXXXXX;} where X is a hexadecimal code. RGB: {color:rgb(X,Y,Z); } where X, Y, and Z are numbers between 0 and 255 Color name: {color:[color_name];}
  118. 118. Font-variant The font-variant property specifies whether the font will be displayed in small caps. Small caps mean that all letters will be displayed in the capital case, but the font size is smaller than usual. The possible values are 'small-caps' and 'normal'. Let's look at the example below. With the following CSS, span { font-variant:small-caps; } the HTML code below, <span>initial in small caps</span> AND LATER IN LARGE CAPS. renders initial in small caps AND LATER IN LARGE CAPS.
  119. 119. LIMITATIONS <ul><li>Poor layout controls for flexible layouts </li></ul><ul><li>Selectors are unable to ascend </li></ul><ul><li>Vertical control limitations </li></ul><ul><li>Absence of expressions </li></ul><ul><li>Lack of orthogonality </li></ul><ul><li>Control of element shapes </li></ul>
  120. 120. WEB2.0
  121. 121. Web 2.0 <ul><li>The term &quot;Web 2.0&quot; is commonly associated with web applications that facilitate interactive information sharing , interoperability , user-centered design , and collaboration on the World Wide Web . </li></ul><ul><li>A Web 2.0 site allows its users to interact with each other as contributors to the website's content, in contrast to websites where users are limited to the passive viewing of information that is provided to them. </li></ul><ul><li>Examples of Web 2.0 include web-based communities, hosted services, web applications, social-networking sites, video-sharing sites, wikis, blogs, mashups, and folksonomies. </li></ul>
  122. 122. characteristics: <ul><li>Web 2.0 websites allow users to do more than just retrieve information. </li></ul><ul><li>They can build on the interactive facilities of &quot;Web 1.0&quot; to provide &quot;Network as platform&quot; computing, allowing users to run software-applications entirely through a browser. </li></ul><ul><li>Users can own the data on a Web 2.0 site and exercise control over that data. These sites may have an &quot;Architecture of participation&quot; that encourages users to add value to the application as they use it. </li></ul><ul><li>The concept of Web-as-participation-platform captures many of these characteristics. Bart Decrem, a founder and former CEO of Flock, calls Web 2.0 the &quot;participatory Web&quot; and regards the Web-as-information-source as Web 1.0. </li></ul>
  123. 123. Technology overview: <ul><li>Web 2.0 draws together the capabilities of client- and server-side software, content syndication and the use of network protocols. </li></ul><ul><li>Standards-oriented web browsers may use plug-ins and software extensions to handle the content and the user interactions. </li></ul><ul><li>Web 2.0 sites provide users with information storage, creation, and dissemination capabilities that were not possible in the environment now known as &quot;Web 1.0&quot;. </li></ul>
  124. 124. features and techniques in web2.0: Search: Finding information through keyword search . Links: Connects information together into a meaningful information ecosystem using the model of the Web, and provides low- barrier social tools. Authoring: The ability to create and update content leads to the collaborative work of many rather than just a few web authors. In wikis, users may extend, undo and redo each other's work. In blogs, posts and the comments of individuals build up over time.
  125. 125. features and techniques: Tags: Categorization of content by users adding &quot;tags&quot; - short, usually one- word descriptions - to facilitate searching, without dependence on pre- made categories. Collections of tags created by many users within a single system may be referred to as &quot;folksonomies&quot; (i.e., folk taxonomies). Extensions: Software that makes the Web an application platform as well as a document server. Signals: The use of syndication technology such as RSS to notify users of content changes.
  126. 126. Usage: <ul><li>Blogs, wikis and RSS are often held up as exemplary manifestations of Web 2.0. </li></ul><ul><li>A reader of a blog or a wiki is provided with tools to add a comment or even, in the case of the wiki, to edit the content. </li></ul><ul><li>This is what we call the Read/Write web.Talis believes that Library 2.0 means harnessing this type of participation so that libraries can benefit from increasingly rich collaborative cataloguing efforts, such as including contributions from partner libraries as well as adding rich enhancements, such as book jackets or movie files, to records from publishers and others. </li></ul>
  127. 127. Web-based applications and desktops: <ul><li>Ajax has prompted the development of websites that mimic desktop applications, such as word processing, the spreadsheet, and slide-show presentation. </li></ul><ul><li>WYSIWYG wiki sites replicate many features of PC authoring applications. In 2006 Google, Inc. acquired one of the best-known sites of this broad class, Writely. </li></ul><ul><li>Several browser-based &quot; operating systems&quot; have emerged, including EyeOS and YouOS. </li></ul><ul><li>Although coined as such, many of these services function less like a traditional operating system and more as an application platform. </li></ul><ul><li>They mimic the user experience of desktop operating-systems, offering features and applications similar to a PC environment, as well as the added ability of being able to run within any modern browser. However, these operating systems do not control the hardware on the client's computer. </li></ul>
  128. 128. XML and RSS: <ul><li>Advocates of &quot;Web 2.0&quot; may regard syndication of site content as a Web 2.0 feature, involving as it does standardized protocols, which permit end-users to make use of a site's data in another context . </li></ul><ul><li>Protocols which permit syndication include RSS (Really Simple Syndication — also known as &quot; web syndication &quot;), RDF , and Atom, all of them XML-based formats. Observers have started to refer to these technologies as &quot;Web feed&quot; as the usability of Web 2.0 evolves and the more user-friendly Feeds icon supplants the RSS icon. </li></ul><ul><li>Specialized protocols </li></ul><ul><li>Specialized protocols such as FOAF and XFN (both for social networking) extend the functionality of sites or permit end-users to interact without centralized websites. </li></ul><ul><li>Other protocols, like XMPP enables services to users like Services over the Messenger </li></ul>
  129. 129. Web APIs: <ul><li>Web 2.0 often uses machine-based interactions such as REST and SOAP. </li></ul><ul><li>Often servers use proprietary APIs, but standard APIs (for example, for posting to a blog or notifying a blog update) have also come into wide use. Most communications through APIs involve XML or JSON payloads. </li></ul><ul><li>Web Services Description Language (WSDL) is the standard way of publishing a SOAP API and there are a range of Web Service specifications. </li></ul>
  130. 130. Thank you!!!!