Web pages that contain PHP that is to be executed by hopper must follow a few simple rules:
The web page must have a .php
file extension.
Any PHP code within that page that is to be executed must appear between the
<?php ... PHP code here ... ?>
tags.
These tags may be used as often as you like in any given web page. However, the fewer the tags, the more efficiently the code is processed. Variables are scoped throughout the entire page and may be used within multiple tags.
All web pages must have
-rw-rw-r--
(owner: read/write; group: read/write; public: read) access permission. You may grant web pages these permissions from your SFTP tools (such as Filezilla) or from the command line with the command
chmod 664
Note that the read/write group permission is to allow all members of a project group to edit a file.
The following code produces a simple 'Hello World' web page:
<html> <head> <title>Hello World</title> </head> <body> <?php print( 'hello world' ); ?> </body> </html>
See: http://hopper.wlu.ca/~dbrown/hello.php
phpinfo
The following code produces a formatted list of current PHP settings using
the phpinfo
function:
<html> <head> <title>PHP Info</title> </head> <body> <?php phpinfo(); ?> </body> </html>
The phpinfo
function is very useful when you need to see the
values of various Apache and PHP variables, particularly those passed from
forms or through URLs.