Affluent Internet Applications for SLA Analysis Basal Database Alternation
21 July 03:21
As discussed in the Overview, the AMFPHP scripts acquiesce Beam movies and Beam Advice Server applications to acquaint with PHP scripts . These scripts can receive, process, and acknowledgment data to the requesting cine or application. In the ambience of SLA research, conceivably the alotof advantageous action of such scripts is database alternation involving the inserting, updating, and retrieving of information.
= Ambience Up AMFPHP =
After downloading the AMFPHP scripts from http://www.amfphp.org and unzipping them, the gateway.php book should be placed in a agenda of the web server; be abiding that it is a agenda in which the beheading of scripts is accustomed by the web server. On some servers, this is aural the cgi-bin agenda or a subdirectory thereof. The AMFPHP flashservices binder is about installed aural the cgi-bin directory. Then, a subfolder for admission by the alone Beam cine (or FlashComm application) should be created. Into this subfolder should be placed gateway.php; normally, this book should not crave any editing. For this tutorial, the subfolder will be called mysql_amfphp.
Finally, a subfolder called casework should be created in the mysql_amfphp folder. The casework binder will accommodate the PHP book that accesses the database. For this sample application, a book called MySQLQuery.php should be created and the afterward cipher should be placed aural it using a basal argument editor (Notepad on Windows, vi or emacs on UNIX/LINUX, for example).
chic MySQLQuery
action inRecord($fName, $lName)
action outRecord($message)
acknowledgment $message . ^ }
}
?>
= Ambience Up the Database =
In the archetype code, the ethics DBNAME, USERID, and Countersign should be afflicted to reflect the specific database server to be accessed. Furthermore, the database should accommodate a database called amfphp_test, which contains a table called people. The table humans should, in turn, accommodate two columns: firstName and lastName.
= Creating the Beam Cine =
Using the apparatus window in Beam MX 2004, make a user interface with the elements apparent in the image.
The UI elements aloft should be accustomed the afterward names:
These names will bout the afterward ActionScript code, which should be placed in the first anatomy of the capital timeline of the Beam movie:
// All-important chic (needed for AMFPHP)
#include NetServices.as
// just for debugging purposes
#include NetDebug.as
// Make the AMFPHP aperture and affix to the server.
// The gateway.php book credibility to the casework binder (see below,
// area the account is infact alleged with getService(MySQLQuery)
NetServices.setDefaultGatewayUrl(http://www.MYSERVERNAME.com/cgi-bin/mysql_amfphp/gateway.php);
conn = NetServices.createGatewayConnection();
//Result handler
appeal = new Object();
request.onResult = function(result)
// Alarm the service; name of account (MySQLQuery) haveto be the same
// as the pre-extension name of the book in the casework folder: MySQLQuery.php
account = conn.getService(MySQLQuery);
// Buttons
callButton.onPress = function()
clearButton.onPress = function()
insertButton.onPress = action () ;
stop();
After exporting the movie, a user should be able to admit first- and last-name pairs into the database. The PHP cipher allotment a acceptance bulletin both if inserting and retrieving database information. If inserting information, the first and endure names will be returned; if retrieving, whatever argument is in the high window will be beatific and added to the alpha of the alternate information, followed by a account of the names (in endure name, first name order) in the database.
= Accessible Uses =
The sample appliance aloft illustrates how a Beam cine ability admission a database. Such admission ability be acclimated for login authentication, creating a new user account, or extenuative textual advice for approaching retrieval and study.
It is account acquainted that advice in a database neednt be accessed alone by the AMFPHP cipher or Beam cine that created it. If, for example, the archetype of a argument babble were adored as a database entry, addition Beam cine could be acclimated to retrieve it for analysis by a researcher. A PHP script, likewise, could retrieve the archetype and accomplish argument abetment operations on it (e.g., agreement the HTML tags for adventurous text, & , about words not in the 1000 alotof common words/word families in English).
In the next section, a sample appliance will be acclimated to authenticate how argument from a babble appliance ability be adored for after retrieval.
= Ambience Up AMFPHP =
After downloading the AMFPHP scripts from http://www.amfphp.org and unzipping them, the gateway.php book should be placed in a agenda of the web server; be abiding that it is a agenda in which the beheading of scripts is accustomed by the web server. On some servers, this is aural the cgi-bin agenda or a subdirectory thereof. The AMFPHP flashservices binder is about installed aural the cgi-bin directory. Then, a subfolder for admission by the alone Beam cine (or FlashComm application) should be created. Into this subfolder should be placed gateway.php; normally, this book should not crave any editing. For this tutorial, the subfolder will be called mysql_amfphp.
Finally, a subfolder called casework should be created in the mysql_amfphp folder. The casework binder will accommodate the PHP book that accesses the database. For this sample application, a book called MySQLQuery.php should be created and the afterward cipher should be placed aural it using a basal argument editor (Notepad on Windows, vi or emacs on UNIX/LINUX, for example).
chic MySQLQuery
action inRecord($fName, $lName)
action outRecord($message)
acknowledgment $message . ^ }
}
?>
= Ambience Up the Database =
In the archetype code, the ethics DBNAME, USERID, and Countersign should be afflicted to reflect the specific database server to be accessed. Furthermore, the database should accommodate a database called amfphp_test, which contains a table called people. The table humans should, in turn, accommodate two columns: firstName and lastName.
= Creating the Beam Cine =
Using the apparatus window in Beam MX 2004, make a user interface with the elements apparent in the image.
The UI elements aloft should be accustomed the afterward names:
These names will bout the afterward ActionScript code, which should be placed in the first anatomy of the capital timeline of the Beam movie:
// All-important chic (needed for AMFPHP)
#include NetServices.as
// just for debugging purposes
#include NetDebug.as
// Make the AMFPHP aperture and affix to the server.
// The gateway.php book credibility to the casework binder (see below,
// area the account is infact alleged with getService(MySQLQuery)
NetServices.setDefaultGatewayUrl(http://www.MYSERVERNAME.com/cgi-bin/mysql_amfphp/gateway.php);
conn = NetServices.createGatewayConnection();
//Result handler
appeal = new Object();
request.onResult = function(result)
// Alarm the service; name of account (MySQLQuery) haveto be the same
// as the pre-extension name of the book in the casework folder: MySQLQuery.php
account = conn.getService(MySQLQuery);
// Buttons
callButton.onPress = function()
clearButton.onPress = function()
insertButton.onPress = action () ;
stop();
After exporting the movie, a user should be able to admit first- and last-name pairs into the database. The PHP cipher allotment a acceptance bulletin both if inserting and retrieving database information. If inserting information, the first and endure names will be returned; if retrieving, whatever argument is in the high window will be beatific and added to the alpha of the alternate information, followed by a account of the names (in endure name, first name order) in the database.
= Accessible Uses =
The sample appliance aloft illustrates how a Beam cine ability admission a database. Such admission ability be acclimated for login authentication, creating a new user account, or extenuative textual advice for approaching retrieval and study.
It is account acquainted that advice in a database neednt be accessed alone by the AMFPHP cipher or Beam cine that created it. If, for example, the archetype of a argument babble were adored as a database entry, addition Beam cine could be acclimated to retrieve it for analysis by a researcher. A PHP script, likewise, could retrieve the archetype and accomplish argument abetment operations on it (e.g., agreement the HTML tags for adventurous text,
In the next section, a sample appliance will be acclimated to authenticate how argument from a babble appliance ability be adored for after retrieval.
|
Tags: internet, access, basic, information, example, service, services, server, application, applications, created, database, names, placed, directory, scripts, research, movie, flash, sample database, amfphp, flash, movie, scripts, application, information, function, named, gateway, server, folder, mysqlquery, subfolder, created, names, services, service, placed, directory, example, basic, netservices, onpress, research, following, sample, applications, access, retrieving, mysql, inserting, interaction, , flash movie, gateway php, onpress function, services folder, sample application, mysql amfphp, cgi bin, database interaction, php file, sla research, basic database interaction, research basic database, sla research basic, rich internet applications, |
Also see ...
PermalinkArticle In : Computers & Technology - Internet