PHP is a script language very similar to Perl, but can be embedded inside HTML code syntax. For more information and language documentation, go to PHP.NET.

PHP can be used with our Windows and Linux plans only. PHP is available on Windows 2003 and 2008 servers for customers with Standard, Advanced or Preferred plans: Compare Windows Plans. It is not available on ColdFusion plans.

To make your PHP script work the only thing you need to do is to set it with a .php filename extension.

Note: Sometimes you may also need to set Allow Execute setting on HostPilot > Web/FTP Server > Web Server > Settings and Permissions page for the directory with your PHP files in case the script requires it. This setting only applies to Windows  2003 platform.

To create a PHP script, use .php as the file extension. Basic PHP syntax follows:

<html>
<head><title>PHP page</title></head>
<body>
<p>This paragraph prints as HTML.</p>
<?php
print "<p>Hello, world!</p>\n";
?>
</body>
</html>

Note: future versions of PHP will not support the automatic registration of form variables. The use of automatic global registration has been deprecated due to security risks. For now, Intermedia still supports the old style automatic global registration, but this will be turned off in future versions. Use the following methods:

PHP processes form variables, cookies and session variables automatically, so you can extract them from one of these special global arrays:

  • $_GET - contains form variables sent through GET
  • $_POST - contains form variables sent through POST
  • $_COOKIE - contains HTTP cookie variables
  • $_SERVER - contains server variables (e.g., REMOTE_ADDR)
  • $_ENV - contains the environment variables
  • $_REQUEST - a merge of the GET variables, POST variables and Cookie variables. In other words - all the information that is coming from the user, and that from a security point of view, cannot be trusted.
  • $_SESSION - contains HTTP variables registered by the session module

So, if your form calls the PHP script with the GET method, and contains a field called "name", you would access the value with $_GET["name"].

Click here to lookup a function name in the PHP manual.