HTML and CSS Reference
In-Depth Information
Figure 16-4: Invalid entry caught in the e-mail format.
h e value attribute of the Submit button should be named anything but “Submit” as a good
interactive design practice. h at's why its value is set to Send . (No wants to submit.) Also, the
message isn't one of those hysterical gasps like “FATAL ERROR! E-mail format illegal!” Some
users i nd such messages disconcerting. Also, they're inaccurate — no one died or was
arrested. It was just a boo-boo.
In this short introduction to PHP, you still can learn enough to make a practical application.
However, i rst, you'll want to learn some of the basic structures of PHP. If you know JavaScript
or some other scripting or programming languages, the structures will be familiar. PHP does
have its idiosyncrasies, though, and many readers are unfamiliar with programming, so this
discussion is basic and focused.
All languages include a certain way of storing data temporarily in containers called variables,
constants, or some kind of object such as an array. Some languages are strongly typed and
others are weakly typed. Java, C#, and ActionScript 3.0 are all strongly typed. h at means that
you have to decide on a certain data type and assign that data type to your storage. For
example, an ActionScript 3.0 variable is declared as:
var userName:String = ”SoSueMe”;
h at means you only can assign string data types to the variable, username . If you assign it a
number, Boolean, or nonstring function, it throws an error.
PHP is like JavaScript. If you assign the PHP variable,
$userName = ”SoSueMe” ;
Search WWH ::

Custom Search