Sunday, September 30, 2007

What is CSS

What is CSS?
Maybe you already heard about CSS without really knowing what it is. In this lesson you will learn more about what CSS is and what it can do for you.

CSS is an acronym for Cascading Style Sheets.

What can I do with CSS?
CSS is a style language that defines layout of HTML documents. For example, CSS covers fonts, colours, margins, lines, height, width, background images, advanced positions and many other things. Just wait and see!

HTML can be (mis-)used to add layout to websites. But CSS offers more options and is more accurate and sophisticated. CSS is supported by all browsers today.

After only a few lessons of this tutorial you will be able to make your own style sheets using CSS to give your website a new great look.

What is the difference between CSS and HTML?
HTML is used to structure content. CSS is used for formatting structured content.

Okay, it sounds a bit technical and confusing. But please continue reading. It will all make sense to you soon.

Back in the good old days when Madonna was a virgin and a guy called Tim Berners Lee invented the World Wide Web, the language HTML was only used to add structure to text. An author could mark his text by stating "this is a headline" or "this is a paragraph" using HTML tags such as <h1> and <p>.

As the Web gained popularity, designers started looking for possibilities to add layout to online documents. To meet this demand, the browser producers (at that time Netscape and Microsoft) invented new HTML tags such as for example <span> which differed from the original HTML tags by defining layout - and not structure.

This also led to a situation where original structure tags such as <table> were increasingly being misused to layout pages instead of adding structure to text. Many new layout tags such as <blink> were only supported by one type of browser. "You need browser X to view this page" became a common disclaimer on web sites.

CSS was invented to remedy this situation by providing web designers with sophisticated layout opportunities supported by all browsers. At the same time, separation of the presentation style of documents from the content of documents, makes site maintenance a lot easier.

Which benefits will CSS give me?
CSS was a revolution in the world of web design. The concrete benefits of CSS include:

  • control layout of many documents from one single style sheet;
  • more precise control of layout;
  • apply different layout to different media-types (screen, print, etc.);
  • numerous advanced and sophisticated techniques.

Connecting to MySQL database

This tutorial will show you how to connect to mysql database. It's easy to write a script to connect to world's most popular opensource database.

Define your database information:

* host="localhost" you don't have to change it. When it's on your computer or server it still be localhost

Username = mysqluser
Password = 123456
Database = test

$host="localhost";
$username="phpeasystep";
$password="1234";
$db_name="test";

mysql_connect("$host", "$username", "$password")or die("cannot connect to server");
mysql_select_db("$db_name")or die("cannot select db");

or

mysql_connect("localhost", "phpeaststep", "1234")or die("cannot connect to server");
mysql_select_db("test")or die("cannot select db");

Creating file config.php
$host="localhost";
$username="phpeasystep";
$password="1234";
$db_name="test";


mysql_connect("$host", "$username", "$password")or die("cannot connect to server");
mysql_select_db("$db_name")or die("cannot select db");
save this file as "config.php"
when you want to use this code include it to your main php file

example


include("config.php");

$tbl_name="member";
$sql="SELECT * FROM $tbl_name";
$result=mysql_query($sql);

?>

Adobe Flex 2.0

Now Adobe Releases Flex 2.0 and also available dowload for free trial
The Adobe Flex 2.0 beta is designed to be the most complete application development solution forcreating and delivering cross-platform rich Internet applications within the enterprise or across theWeb.
Adobe Flex The complete solution for building cross-platform rich Internet applications within the enterprise and across the web. Adobe Flex 2.0 delivers an integrated set of tools and technology enabling developers to build and deploy scalable rich Internet applications. Flex provides a modern, standards-based language supporting common design patterns and includes a client runtime, programming model, development environment, and advanced data services.
A Complete SolutionDevelop scalable rich Internet applications using an integrated framework, an easy-to-use development tool, a high-performance client runtime, and advanced data services
A Truely Rich ExperienceCreate compelling, engaging applications using a rich set of pre-built components, including data-visualization, transitions, and so much more.
Well Designed Applications. Since Flex is object oriented, every component or object can encapsulate styles, objects, components, and events, making them easily reusable, extensible, and testable.
Adobe official website

PHP Counter script tutorial

Create your own counter script. Using a basic knowledge of php + mysql script and keeps your visitors number to database for analysis.

Step1. Create table "counter" in database "test".
CREATE TABLE `counter` (
`counter` int(9) NOT NULL default '0'
) TYPE=MyISAM;

Step2. Create file counter.php.
$host="localhost"; // Host name
$username=""; // Mysql username
$password=""; // Mysql password
$db_name="test"; // Database name
$tbl_name="members"; // Table name

// Connect to server and select database.
mysql_connect("$host", "$username", "$password")or die("cannot connect to server "); mysql_select_db("$db_name")or die("cannot select DB")
$sql="SELECT * FROM $tbl_name";$result=mysql_query($sql);
$rows=mysql_fetch_array($result);$counter=$rows['counter'];


// if have no counter value set counter = 1
if(empty($counter)){$counter=1;$sql1="INSERT INTO $tbl_name(counter) VALUES('$counter')";$result1=mysql_query($sql1);}
echo "You 're visitors No. ";

echo $counter;
// count more value
$addcounter=$counter+1;$sql2="update $tbl_name set counter='$addcounter'";$result2=mysql_query($sql2);
mysql_close();

?>


CSS Start

How many times do we see in forum pages the cry; "I've tried using Suckerfish…", "I've started with Suckerfish and made some minor changes but can't get it to work".
My advice is to forget Suckerfish or any other 'out-of-the-box' menu or menu generating software. Sooner or later it will not perform as you expected and you won't know why.
Start by understanding the building blocks of creating css driven menus. Then you can put your own vertical or horizontal menu templates together and you will understand how they work. If and when the need arises, you will have a good idea where to start 'tweaking'. I shall assume nothing and take this tutorial from basics, so forgive me if you understand some of this already.