Prev | Current Page 26 | Next

Larry Ullman

"Building a Web Site with Ajax: Visual QuickProject Guide"


2 The script then attempts to select the ajax database. This is the
name of the database created in Chapter 1.
3 Error messages are
printed if either attempt
fails. If so, the script then
terminates because there??™s
no need to go on without a
database connection.
4 Save this fi le as mysql.
inc.php and place it in the
same directory on your Web
server as dept_form.html.
18 browsing employees
body {
font-family: sans-serif;
}
.name {
font-weight: bold;
text-transform: uppercase;
color: #009;
}
.error {
font-weight: bold;
color: #C00
}
#results {
border: medium solid #390;
display: none;
padding-left: 10px;
width: 300px;
}
create a style sheet
The CSS style sheet is a separate document that dictates how the pages look. Create a
new fi le in your test editor or IDE, containing this code. (See extra bits on page 24.)
The body section sets the default font for the entire HTML page.
The second section formats text with a class value of name. That would
be the employee??™s name in the listing of results in dept_results.php.
The third section applies some formatting to any errors (which will have
a class value of error), like those created in both PHP scripts.


Pages:
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38