music |
| | OSdata.com |
preprocess
summary
Preprocessing portion of the music player.
Source code for the music player
license
This is example code from This Side of Sanity, released under Apache License 2.0.
Copyright 2012, 2013, 2014 Milo
Licensed under the Apache License, Version 2.0 (the License); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
summary
Preprocessing portion of the music player.
Source code for the music player
beginning of file
The standard beginning of a PHP file declares the scripting language.
<?php
/* FILE NAME /musicbox/musicbox.php */
/******************************/
/* Pre-Process */
/* pre-process */
/******************************/
includes
This section includes a number of support files. the support files are used to logically group routine sand other source code, as well as to allow multiple source files to share the same source code.
The PHP function require_once is one of several methods for sharing material from source code files.
See PHP Manual: require_once for more information.
// include function files for this application
require_once("databasefunctions.php");
require_once("visitorauthorization.php");
require_once("header.php");
require_once("menu.php");
require_once("output.php");
collect session globals
Collect cookie, PUT, and GET variables into $_SESSION.
See PHP Manual: session_start for more information.
session_start();
set user globals
It is bad programming practice to use globals. Globals create hidden side effects.
Always use globals sparingly.
Declare a few gloabl variables to avoid proliferation of parameters.
/******************************/
/* GLOBALS */
/******************************/
global $visitorresult;
global $adminflag;
global $websitename; /* not used in this simplified source code */
global $visitoridnum;
global $visitoracctname;
Source code for the music player
contact
comments, suggestions, corrections, criticisms
Names and logos of various OSs are trademarks of their respective owners.