Microsoft Word - Core PHP Programming Using PHP to Build Dynamic Web Sites

(singke) #1

Notice that in the first segment of the PHP script, I have eliminated the lines setting the
variables, except for today's date. The rest of the script is unchanged. The script assumes
there will be data in the variables. Try experimenting with the scripts by entering
nonsense in the form fields.


One thing you should notice is that if you put words where the script expects numbers,
PHP seems to just assign them values of zero. The variables are set with a text string, and
when the script tries to treat it as a number, PHP does its best to convert the information.
Entering 10 Little Indians for the cost of lunch will be interpreted as 10.

Free download pdf