Raspberry Pi_Eng_24.4.7 Stop and Return of Processing

24.4.7 Stop and Return of Processing

24.4.7.1 “exit” Statement and “die” Statement

“exit” statement is a command that prints the specified message and terminates the execution of the PHP script. “die” statement is the same command as “exit” statement.

exit ( [ status-message ] )

exit ( [ status-number ] )

Raspberry Pi_Eng_24.4.5 Output

24.4.5 Output

You can use “echo” and “print” commands to print processing results in PHP. Both perform almost the same function. The text to be processed may include an HTML tag.

24.4.5.1 “echo” Command

“echo” command has no return value and can process several parameters simultaneously.

Raspberry Pi_Eng_24.4.3 Summary of PHP Syntax

24.4.3 Summary of PHP Syntax

If there is a static HTML tag on a web page, that page will always show the same content. However, if you use PHP to change the content of these HTML pages, the page will show the new changed contents. Like this, PHP plays a role to change the contents of a static HTML page into dynamic page. Therefore, according to the situation requested within the static HTML, a new HMTL is created and integrated with the existing static HTML tag to become an HTML document constituting a complete page.

Raspberry Pi_Eng_24.4.2 Installing PHP and Connection Tool to MySQL

24.4.2 Installing PHP and Connection Tool to MySQL

When installing PHP on Raspberry Pi, use the following command:

sudo apt-get install php5

If PHP is installed, the configurations of existing Apache are automatically adjusted so that PHP can integrate with Apache.

Raspberry Pi_Eng_24.4.11 PHP and MySQL database

24.4.11 PHP and MySQL database

24.4.11.1 PHP MySQL extension

The functions for processing MySQL data in PHP are developed and provided as extensions of PHP. The following extensions have been developed so far.

■ Original MySQL extension

This is an extension function that was originally developed to access MySQL data in PHP. It was originally developed with the assumption that it will be applied only to systems prior to MySQL version 4.1.3. It can be applied to later versions, but it can not fully utilize the functions of the latest MySQL server, and it will be discarded in the future.

Raspberry Pi_Eng_24.4.10 Transmission Methods of PHP and Key Global Variable

24.4.10 Transmission Methods of PHP and Key Global Variable

24.4.10.1 POST/GET Method of HTTP and PHP Processing

GET method and POST method can be used when a web browser calls the web server and send the necessary data.

● GET method

Raspberry Pi_Eng_24.4.1 HTML and PHP

24.4 PHP Web Script Language

24.4.1 HTML and PHP

24.4.1.1 Needs for PHP

On the Internet, all web servers use HTML to receive a request from web browser which is client, and then deliver the necessary data accordingly to the web browser to express it as a general form that human can understand. HTML (Hyper-Text Markup Language) allows a web server to communicate with a web browser and send/receive data each other, and return the processing results back to people.