If you can't read please download the document
Upload
jeremy-kendall
View
1.092
Download
0
Embed Size (px)
DESCRIPTION
We'll look at a typical first PHP application, review a few of the horrible mistakes the fictional developer made, and then refactor the app according to some best practices. Along the way you might even learn a thing or two about PHP you don't already know.Presented at Memphis PHP on Feb 23, 2012.
Citation preview
2. Who is this guy?
3. Following Along
4. Why Did YouStart Programming? 5. I wanted to solve problems, but . . . 6. . . . I frequently causedas many problemsas I solved. 7. Let's Solve a Problem Together
8. Make horrible mistakes 9. Correct those mistakes 10. Make a cool improvement 11. Learn something? 12. What's the Problem?
13. Requirements:
14. Add books 15. Edit books 16. Delete books Why no delete? I ran out of time and energy. 17. So, What do we Need?
18. View (index.php) 19. Form (book-form.php) 20. Form processor (process-form.php) 21. index.php db connection < table > < tr > < th > Title th >< th > Author th > tr > < tr > < td > < a href= "book-form.php?id=" > a > td > < td > td > tr > table > < p > We have no books! p > 27. index.php books table < table > < tr > < th > Title th >< th > Author th > tr > < tr > < td > < a href= "book-form.php?id=" > a > td > < td > td > tr > table > < p >We have no books! p > 28. index.php books table < table > < tr > < th >Title th >< th >Author th > tr > < tr > < td > < a href= "book-form.php?id=" > a > td > < td > td > tr > table > < p >We have no books! p > 29. index.php books table < table > < tr > < th >Title th >< th >Author th > tr > < tr > < td > < ahref="book-form.php?id="> a > td > < td > td > tr > table > < p > We have no books! p > 30. 31. book-form.php 32. book-form.php