PTM Logo Version 0.5.1 Beta
Home    SVN    Downloads    Documentation    Forum    Contact
This Site is 100%
Powered by PTM

SourceForge.net Logo
Documentation
I   Index
II   GNU GPL
III   Description
IV   Installation
V   Language Overview
VI   Tags
VII   Variables
  $_BASE
  $_CGI
  %_COOKIES
  $_DEFAULT_PTM_FILE
  $_DOCUMENT_ROOT
  %_GET
  $_HEADER
  @_KEYWORDS
  $_PATH
  %_POST
  @_PTM
  $_PTM_POS
  $_PTM_PREPROCESS
  @_REQUIRE
  $_SCRIPT
  %_SERVER
  %_SESSION
  %_SET_COOKIES
  $_SYNTAX_...
  $_URL
  $_USE_SECURE_SCRIPT_PASSING
  $_VERSION
VIII   Functions
IX   Modules
Documentation
View / Download this file.
---------------
$_BASE VARIABLE
---------------

  -----------
  DESCRIPTION
  -----------

    The $_BASE variable stores the URL (slash terminated) to the requested PTM
    script, not including the PTM script's file name. Meaning that if the
    requested script was "http://www.mysite.com/index.ptm", $_BASE would contain
    "http://www.mysite.com/". This variable was created to be used primarily in
    HTML "base" tags, for when the developer has decided to use .htaccess
    virtual redirection to make URLs look nice.
    
      Example:
        "http://www.mysite.com/10/"
        - Redirected To -
        "http://www.mysite.com/index.ptm?page=10"

    When redirections like this occur, the use of a "base" tag is necessary to
    let the browser know "./images/" refers to "http://www.mysite.com/images/"
    and not "http://www.mysite.com/10/images/". In the given example, $_BASE
    would hold "http://www.mysite.com/", without the "10/", because the PTM
    script file actually exists in the root web accessible directory and not in
    a "10" subdirectory. $_BASE always stores the URL path to the script AFTER
    any URL redirection has occured.

    The $_BASE variable is also useful as it gives you a constant URL path to
    your script, even if redirection has occured, so you always know where you
    are.

  --------------
  USAGE EXAMPLES
  --------------

    -----------------------------------------------------------------
    Example 1: Setting Your HTML Base Directory Using the DISPLAY Tag
    -----------------------------------------------------------------

      <head>
        <base href="<?= $_BASE ?>">
      </head>

    ----------------------------------------------------------------------------
    Example 2: Showing the Script's Actual URL with the DISPLAY Tag and $_SCRIPT
    ----------------------------------------------------------------------------

      This script is located at <?= "$_BASE$_SCRIPT" ?>

  --------
  SEE ALSO
  --------

    TAGS

      DISPLAY

    VARIABLES

      $_DOCUMENT_ROOT, $_PATH. %_SERVER, $_SCRIPT, $_URL
Home    SVN    Downloads    Documentation    Forum    Contact