OverviewAuthor: Gareth Downes-Powell
So far in this book, we've been using features of Dreamweaver MX to introduce PHP code into our pages. However, in this chapter, we'll take a look at hand coding within the Dreamweaver MX environment - that is, typing in and amending PHP code and HTML. We'll start with an overview of PHP code syntax. We won't go into too much depth, but will give enough explanation to give you a step up towards writing your own PHP code and understanding the examples in this chapter. We'll then discuss the benefits of hand coding, setting up the code-editing environment, and explain the new features of Dreamweaver MX that make hand coding easier. There are various good coding practices, which will be explained along with details of the functions in Dreamweaver MX that can help you to achieve them. You'll be able to ensure that your code is readable, and easy to edit if you need to change it in the future. We finish the chapter with a practical example, in which we add a user login system to our Dreamweaver Hotel project, so that staff can log in and view bookings. We look at validating data, reading and writing to a database table, and using sessions to create a secure area for the hotel staff that outsiders cannot access. |