Create Base URL and include PHP file with Base URL in Core PHP

You have to define first and then you can include any php file with SERVER_ROOT.  if you are using URL without extension or you want to call a php file with slash e.g. (http://xyz.com/services/web) then you can use base url, so every php plugin should include with baseURL so it have no effects of page URL change.

  1. Define base url:
  2. Include with base URL:

    Note: you can simply define BASE_URI in a saperate file baseURL.php and include in Index.php, and you can use include with base URL.in every page.

baseURL

Syntax

ParameterDescription
nameRequired. Specifies the name of the constant
valueRequired. Specifies the value of the constant
case_insensitiveOptional. Specifies whether the constant name should be case-insensitive. Possible values:

  • TRUE – Case-insensitive
  • FALSE – Default. Case-sensitive

Leave a Reply

Your email address will not be published. Required fields are marked *