Practical PHP and MySQLBuilding Eight Dynamic Web Applications phần 1 pdf

53 393 1
Practical PHP and MySQLBuilding Eight Dynamic Web Applications phần 1 pdf

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

[...]... STARTED WITH PHP PHP and HTML are good friends Working side by side, the PHP and HTML pals are so reliant on each other that it is virtually impossible to tear them apart Whenever you do any kind of Web development, you use PHP and HTML 17 18 Practical PHP and MySQL interchangeably on the vast majority of scripts that you write Both your HTML and PHP code will reside in any files that end in php To begin,... happens is that the PHP 19 20 Practical PHP and MySQL interpreter on the server reads any PHP commands, executes them, and spits out HTML as the final output In this example, the PHP echo command was used to send the contents within the double quotes to the Web browser Each command in PHP ends in a semi-colon (;), and you can see it at the end of the echo command NOTE Using HTML Within PHP You can use... concepts, the real action happens inside the applications you will write Each project provides a means to explore further into the many aspects of programming PHP and MySQL Web applications, and the general ethos is of learning by doing instead of learning by reading 15 16 Practical PHP and MySQL SETTING UP PHP AND MYSQL When I started teaching people how to use PHP and MySQL, I would typically teach it within... HTML code (the basic code that a Web browser understands) and nothing else The page contains only a list of spyrelated text, and there is no interactivity You simply connect to www.thewebaddressofthesite.com, and the Web site displays the information Figure 1- 1 shows the kind of interaction involved with this example FIGURE 1- 1 How a Web browser connects to a Web site HTML Web Site Apache Server Client... file that has a php extension instead of the htm or html extension This is because all PHP scripts that you will use are ultimately converted into text that the Web browser can CHAPTER 2 Getting Started with PHP and MySQL understand You should always remember that the Web browser has no idea what PHP is The Web browser understands text, HTML, and CSS only It is the Web server that runs PHP that does... explore new concepts and skills, and push your knowledge further, while always writing relevant Web applications 13 This page intentionally left blank CHAPTER 2 Getting Started with PHP and MySQL As the proud owner of Practical PHP and MySQL or a prospective owner rifling though it in a bookstore—you will be pleased to know that this book consists of a number of real-world Web applications that are... content here The grand plan is to show you enough of PHP and MySQL to get started and then get on with the interesting stuff: writing applications This chapter discusses core PHP language fundamentals such as loops and variables and then moves on to cover how to create a database and access it from PHP The chapter concludes with coverage of sessions, a key technology used in most Web applications Although... is an incredibly useful and often used feature in PHP Remember that you can only put HTML tags inside legitimate PHP commands You can’t just dump HTML inside a PHP block like this: < ?php Boogaloo with my didgeridoo ?> Everything inside the < ?php and ?> tags is expected to be PHP, and the tags are HTML (not PHP) Using Variables Variables are the bread and butter of any programming... loads the relevant file to handle the form submission This file contains PHP code that is used to connect to the database This PHP code is passed to the PHP interpreter by Apache and run by the interpreter PHP connects to the MySQL database (which may be on the same computer or another one; it doesn’t matter 11 12 Practical PHP and MySQL which) When connected to the MySQL database, a request is made... In addition to PHP s capability as a Web scripting language, PHP also can be used as a shell scripting language This means that you can use a single language to write Web applications and create shell scripts to manage your computers You can even use PHP for creating desktop applications Although this usage was typically one for the wiry-haired and zany part of the PHP demographic, more and more developers . Cataloging-in-Publication Data Bacon, Jono. Practical PHP and MySQL : building eight dynamic web applications / Jono Bacon. p. cm. Includes index. ISBN 0 -13 -223997-3 (pbk. : alk. paper) 1. PHP (Computer program language). Hat Linux Bible series, Linux Toys series, and the signature book for this series, Live Linux CDs. Practical PHP and MySQL ® Building Eight Dynamic Web Applications Jono Bacon NEGUS LIVE LINUX. . . 11 0 CHAPTER 5 Discussion Forums . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 1 Under the Hood . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 1 Building

Ngày đăng: 12/08/2014, 21:21

Từ khóa liên quan

Mục lục

  • Contents

  • Foreword

  • About the Author

  • Acknowledgments

  • Introduction

    • A Different Approach

    • What You Need to Use This Book

    • Conventions

    • Onward

    • CHAPTER 1 A New Approach

      • The Technology

      • How the Dynamic Web Works

      • Summary

      • CHAPTER 2 Getting Started with PHP and MySQL

        • Setting Up PHP and MySQL

        • Getting Started with PHP

        • Rolling in MySQL

Tài liệu cùng người dùng

Tài liệu liên quan