PHITE: Call Script

Home

> Quick Start
> Basic Concepts
> Code Examples
        • Brenda's Pictures
        • Environment
        • Call A Form
        • Edit This Page
        • Auto Links
        • Call Script
        • Popups
        • Counter
        • Example Form 1
        • Example Form 2
        • Page Redirect
        • Type test
        • Blog
        • News Feed 1
        • News Feed 2
> Tool Examples
> Choose Skin
> Contact Me
> Help
> Credits
> Downloads
> PHITE Sites

Links
PHP
TemplatePower
ZOPE
HotScripts
ScriptSearch

Phite (GitHub)
PHITE is now listed on GitHub


Function PHITE_script()


Provides a standard way to call a script from an element or a block.

The function takes one to four arguments.
  1. The first argument is a string giving the name of the script to be called, which must be a .inc file in PHITE's Script directory.
  2. The second argument is optional, but if it exists it is a string giving the path (relative to the .inc file that this function is called from) for a script data file (including extension).
  3. The third argument is an optional array that will be extracted to build a set of variables (where the variable name is the key and the value is the value).
  4. The fourth argument is an optional value that defines the separator of the data file.
The script data file may contain variables, that will be set, and/or a LIST of records that will be extracted into the array
$PHITE_listdata[][].

See the examples to understand the format of the standard script data file. The reason for the extensive use of $PHITE_ is to prevent any name clash in scripts.

Note: Do not create YOUR OWN variables in your scripts that start with $PHITE_ The script itself can just reference any of the variables by name, and/or use the prepared $PHITE_listdata[][] array.

No global declarations are necessary.

Test Script file

April 24, 2024
Teddy =bear

0AlabamaMontgomery
1AlaskaJuneau
2Arizona Phoenix
3ArkansasLittle Rock
4CaliforniaSacramento
5ColoradoDenver
6ConnecticutHartford
7DelawareDover
8FloridaTallahassee
9GeorgiaAtlanta
10HawaiiHonolulu
11IdahoBoise



Files in this directory

Files in ./PT_007_Code_Examples/PT_040_Call_Script

test.inc

body_script.inc

data.txt

File/Folder List
data.txt
test.inc
body_script.inc

 
Chris Robson 2002, Tom Brennfleck 2009
Privacy        Disclaimer
Online: 1    Today: 1    Total: 74,109
Powered by Phite