23.03.2017 Views

wilamowski-b-m-irwin-j-d-industrial-communication-systems-2011

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

62<br />

Development of<br />

Interactive Web Pages<br />

Pradeep Dandamudi<br />

Auburn University<br />

62.1 Introduction..................................................................................... 62-1<br />

62.2 Installations...................................................................................... 62-2<br />

WAMP Server<br />

62.3 Introduction to PHP....................................................................... 62-3<br />

Variables. •. Conditional Statements. •. Loops. •. .<br />

Functions. •. Include Function. •. $_GET and $_POST function<br />

62.4 MySQL.............................................................................................. 62-7<br />

Creating a Database. •. Creating a Table. •. Modifying Tables<br />

62.5 Creating Dynamic Web Sites Using PHP and MySQL........... 62-10<br />

Connecting to Database. •. SQL Queries with PHP. •. Creating<br />

a Database. •. Creating a Table. •. Insert, Update and Delete queries<br />

References.................................................................................................. 62-14<br />

62.1 Introduction<br />

A static Web site, which is generally written in HTML, does not provide the functionality to dynamically<br />

extract the information because static Web sites do not store information in a database, lacking the<br />

functionality needed for dynamic Web sites. In most cases, because static Web pages do not carry large<br />

amount of information, all the information is embedded in the static Web site.<br />

Dynamic Web sites [3] interact dynamically with the client by taking requests from the client, sending<br />

them to the server for processing, and displaying the results on the Web page. Meanwhile, the server<br />

interacts with the database to extract the information required for the user, formats the information<br />

so that the user can read it, and sends it back to the client browser. HTML alone does not provide the<br />

functionality needed for a dynamic, interactive environment. The most common scripting languages<br />

used for developing dynamic Web sites are PHP, Perl, and Python. Figure 62.1 shows the data flow in a<br />

dynamic, interactive client-server environment.<br />

PHP, a server-side scripting language, is the most popular technology that is especially suited for<br />

developing dynamic, interactive Web sites. PHP, which originally stood for “personal home page,” and is<br />

an open-source software initially created to replace a small set of Perl scripts that had been used in Web<br />

sites. Gradually PHP became a general purpose scripting language that is used especially for Web development<br />

and now called “hypertext preprocessor.” PHP is embedded into HTML and interpreted on a<br />

Web server configured to operate PHP scripts. PHP is a server-side scripting language similar to other<br />

server-side scripting languages like Microsoft’s Active Server Pages and Sun Micro<strong>systems</strong>’ JavaServer<br />

Pages [1]. PHP resembles it a syntax to C and PERL. The main difference between PHP and PERL lays in<br />

the set of standards built in libraries that support the generations of HTML code, processing data from<br />

and to the Web server, and handling cookies [4]. PHP is used in conjunction with database <strong>systems</strong>, such<br />

62-1<br />

© <strong>2011</strong> by Taylor and Francis Group, LLC

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!