sa_http_php_page_interpreted system procedure

Returns the result of passing the PHP code that is to be interpreted through a PHP interpreter using the specified parameters for context information such as headers, GET/POST data, protocol version, request URL, method, and so on.

Syntax
sa_http_php_page_interpreted( 
php_page, 
method, 
url, 
version, 
headers, 
request_body 
)
Arguments
  • php_page   This LONG VARCHAR parameter contains the entire PHP code that is to be interpreted, including the starting and ending markers (<?php and ?>).

  • method   This LONG VARCHAR parameter contains the HTTP request method (for example, GET, POST, PUT, or one of the other standard request methods). The value for method can be determined using the value of @HttpMethod in the current HTTP request.

  • url   This LONG VARCHAR parameter contains the full HTTP request URL, including the query string, if present. The value for url can be determined using the value of @HttpURI in the current HTTP request.

  • version   This LONG VARCHAR parameter contains the HTTP request protocol version (for example, HTTP/1.1). The value for version can be determined using the value of @HttpVersion in the current HTTP request.

  • headers   This LONG BINARY parameter contains the HTTP request headers in the standard HTTP header format: Field-Name: Value\r\n. The value for headers can be retrieved from the current HTTP request using the following SELECT statement:
    SELECT LIST( name || ': ' || value, CHAR(13) || CHAR(10) ) 
       FROM sa_http_header_info();

  • request_body   This LONG BINARY parameter contains the HTTP request body in binary form. The value for request_body can be retrieved from the current HTTP request using the HTTP_BODY function. See HTTP_BODY function [HTTP].

Remarks

To use this system procedure, the PHP external environment must already be installed. See The PHP external environment.

To use this system procedure outside web services requests, you must provide request information. Any headers set within the PHP code are lost.

The owner of this system procedure is DBO. However, for improved security, the sa_http_php_page_interpreted system procedure is executed as the invoker.

Permissions

None

Side effects

None

See also