music

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

see full player in action

return to explanation of simple player

contact
comments, suggestions, corrections, criticisms

please contact us

your name:
email address:
phone number:
message:

return to table of contents
free downloadable college text book

previous page next page
previous page next page


[画像:Made with Macintosh]

This web site handcrafted on Macintosh computers using Tom Bender’s Tex-Edit Plus and served using FreeBSD .

Viewable With Any Browser


UNIX used as a generic term unless specifically used as a trademark (such as in the phrase “UNIX certified”). UNIX is a registered trademark in the United States and other countries, licensed exclusively through X/Open Company Ltd.

Names and logos of various OSs are trademarks of their respective owners.

Copyright © 2011, 2012 Milo

Created: May 5, 2012 (using code started in September 2011)

Last Updated: May 10, 2012


return to table of contents
free downloadable college text book

Quantcast

AltStyle によって変換されたページ (->オリジナル) /