Archive | June, 2008

HTML Basics

CSS was designed to work with HTML. To take advantage of CSS, you need to know some HTML. As stated in the Preface, we assume most readers have had some exposure to HTML. However, to ensure we all talk about the same thing, we now review the basics of HTML.

Read the full story

Posted in Misc ApplicationsComments (0)

HTML is Markup Language

A markup language is a method of indicating within a document the roles that the document’s pieces are to play. Its focus is on the structure of a document rather than its appearance. For example, you can indicate that one piece of text is a paragraph, another is a top-level heading, and another is a lower-level heading. You indicate these by placing codes, called tags, into the document. HTML has around 30 commonly used tags, which are reviewed later in this chapter. You could, for example, use a tag that says, in effect, “Make this piece of text a heading.”

Read the full story

Posted in Web DesignComments (0)

The Web and HTML

Cascading Style Sheets (CSS) represent a major breakthrough in how Web-page designers work by expanding their ability to control the appearance of Web pages, which are the documents that people publish on the Web.

For the first few years after the World Wide Web (the Web) was created in 1990, people who wanted to put pages on the Web had little control over what those pages looked like. In the beginning, authors could only specify structural aspects of their pages (for example, that some piece of text would be a heading or some other piece would be straight text). Also, there were ways to make text bold or italic, among a few other effects, but that’s where their control ended.

Read the full story

Posted in Web DesignComments (0)

Creating PHP Variables

That’s not a typoPHP lets you create variable variables. A variable variable is one that holds the name of a variable. Here’s how it works: you create a variable named, say, $apples:

Read the full story

Posted in PHP & MySQLComments (0)

Running PHP on the Command Line

If php is in your path, you can run this from the command line like so (where % is a generic, cross-platform command-line prompt, and this example assumes you’re in the same directory as echo.php):

Read the full story

Posted in PHP & MySQLComments (0)

Mixing PHP in Some HTML

PHP files are most often mixtures of HTML and PHP scripts. Putting HTML and PHP scripts into the same document is no problem because you put your PHP statements inside a script bounded by <?php and ?>, which means the server can pick them out easily.

Read the full story

Posted in PHP & MySQLComments (0)

Creating Your First PHP Script

Here’s where all the action startscreating your first PHP scripts. With PHP, which will be run on the web server, you can make all kinds of things happen that couldn’t happen before. You can have your PHP retrieve data from databases, check someone’s password, print out customized greeting text, use cookies, write a guest book, create interactive games, calculate sales tax, or even build your own shopping cart or chat room web applications. And all these things can run by themselves, 24 hours a day, even while you’re peacefully sleeping in bed.

Read the full story

Posted in PHP & MySQLComments (1)

Getting PHP

Welcome to PHP! “PHP” officially stands for “PHP: Hypertext Preprocessor,” but millions of people still know it by its original name, Personal Home Page, and that’s what it’s all aboutcreating your own interactive web pages in the easiest possible way. No longer will web pages have to be static, unchanging things. Now you can send the user new web pages tailored to what he or she wants to see in real time. You can handle button clicks, checkbox selections, and radio buttons and can even draw graphics interactively and store data in a database. It’s all up to you the lid is off the box.

Read the full story

Posted in PHP & MySQLComments (1)

Inheritance and Aggregation in Java Language

There are two fundamental mechanisms for building new classes from existing ones: inheritance and aggregation. It makes sense to inherit from an existing class Vehicle to define a class Car, since a car is a vehicle. The class Vehicle has several parts; therefore, it makes sense to define a composite object of class Vehicle that has constituent objects of such classes as Motor, Axle, and GearBox, which make up a vehicle.

Read the full story

Posted in Java ProgrammingComments (0)

Java Instance and Static Members

Each object created will have its own copies of the fields defined in its class. The fields of an object are called instance variables. The values of the instance variables in an object comprise its state. Two distinct objects can have the same state, if their instance variables have the same values. The methods of an object define its behavior. These methods are called instance methods. It is important to note that these methods pertain to each object of the class. This should not be confused with the implementation of the methods, which is shared by all instances of the class. Instance variables and instance methods, which belong to objects, are collectively called instance members, to distinguish them from static members, which only belong to the class.

Read the full story

Posted in Java ProgrammingComments (0)

Objects of Java

Class Instantiation

The process of creating objects from a class is called instantiation. An object is an instance of a class. The object is constructed using the class as a blueprint and is a concrete instance of the abstraction that the class represents. An object must be created before it can be used in a program. In Java, objects are manipulated through object references (also called reference values or simply references). The process of creating objects usually involves the following steps:

Read the full story

Posted in Java ProgrammingComments (0)

Basics of Java Programming

Introduction

Before embarking on the road to Java programmer certification, it is important to understand the basic terminology and concepts in object-oriented programming (OOP). In this chapter, the emphasis is on providing an introduction rather than an exhaustive coverage. In-depth coverage of the concepts follows in due course in subsequent chapters of the book.

Java supports the writing of many different kinds of executables: applications, applets, and servlets. The basic elements of a Java application are introduced in this chapter. The old adage that practice makes perfect is certainly true when learning a programming language. To encourage programming on the computer, the mechanics of compiling and running a Java application are outlined.

Read the full story

Posted in Java ProgrammingComments (0)