Web Developement Workshop (Oct 2009) Slides
-
Upload
manish-sinha -
Category
Technology
-
view
1.682 -
download
4
Transcript of Web Developement Workshop (Oct 2009) Slides
Web Development
BY : KARTIK : http://www.kar2905.wordpress.comPRATIK : http://pratik3d.blogspot.comSAURABH : [email protected]
- HTML ( A Fast run through)
- MYSQL
- PHP
- Login Script Demonstration
HYPER TEXT MARKUP LANGAUGE
DEVELOPED BY : World Wide Web Consortium & WHATWG
Type code : TEXT
Extended from : SGML
Extended to : XHTML
Standard(s) : W3C HTML 4.01 W3C HTML 3.2
In short it is the language used to design Web Pages
Use any text editor
Gedit, Notepad++, Notepad,..
Save as .htm or .html extension
A tag is : Non-hierarchical keyword or term assigned to a piece of information
< > - Opening Tag
- Closing Tag
The element content is everything between the start and the end tag ( Hello )
Some HTML elements have empty content(
)
Most HTML elements can have attributes
Its not case sensitive eg means the same as . But W3C (?) recommends lower case
My first web page
Hello everyone
The element defines the whole HTML document.
The element has a start tag and an end tag
The element content is another HTML element (the body)
The element defines the head of the HTML document
The element has a start tag and an end tag
The element content is another HTML element (title of the webpage)
The element defines the body of the HTML document
The element has a start tag and an end tag
The element content is another HTML element (a paragraph)
This is a paragraph
This is a heading
Various headings
< a href=google.com>This is a link
: is used to give a line break
: is used to give a horizontal line
BOLD
ITALICS
Big Text
This is subscript and superscript
This is computer output
BOLD
Many more tags .. http://www.w3schools.com/tags/default.asp
HTML elements can have attributesAttributes provide additional information about the elementAttributes are always specified in the start tagAttributes come in name/value pairs like: name="value"Standard attributes : class ,id , style ,title
Attributes
style="background-color:yellow"style="font-size:10px"style="font-family:Times"style="text-align:centerExamples :
name of textbox
ASSIGNMENT
Getting Started: PHP-MySQL
Create a Connection to a MySQL Database
mysql_connect(servername,username,password);
Eg;
Closing the Connectionmysql_close($con);
$sql=CREATE DATABASE database_name;mysql_select_db("my_db", $con);
$sql = "CREATE TABLE Persons
(
personID int NOT NULL AUTO_INCREMENT,
PRIMARY KEY(personID),
FirstName varchar(15),
LastName varchar(15),
Age int
)";
mysql_query($sql);
All other MySQL commands can be executed like :
$sql= The command here
$mysql_query($sql);
Other Commands
$sql= MySQL command;
$result=mysql_query($sql);
$row=mysql_fetch_array($result);
$num=mysql_num_rows($result);
SESSIONS AND COOKIES
Used to identify a user
Cookies are saved in the client's computer
Sessions are destroyed once the browser is closed
COOKIES
setcookie(name, value, expire, path, domain);
echo $_COOKIE["user"];
if (isset($_COOKIE["user"]))
setcookie("user", "", time()-3600);
SESSIONS
session_start();
$_SESSION['views']=1;
if(isset($_SESSION['views']))
{ echo $_SESSION['views'] ; }
unset($_SESSION['views']);
session_destroy();
LOGIN SCRIPT DEMONSTRATION ....from scratch
Muokkaa otsikon tekstimuotoa napsauttamalla
Muokkaa jsennyksen tekstimuotoa napsauttamallaToinen jsennystasoKolmas jsennystasoNeljs jsennystasoViides jsennystasoKuudes jsennystasoSeitsems jsennystasoKahdeksas jsennystasoYhdekss jsennystaso