It is not possible to emulate the ASP (Microsoft's strongest development language) with PHP (which is now the mainstream development language), especially in the case of PHP (which is now the mainstream development language), for dynamic languages with incomplete object-oriented support. It's a lot of difficulty. In these simulations, it is said that this example can be used to understand the operating mechanism of the ASP. NET (Microsoft's strongest development language). The code is simple, needless to say, this test in Win2000,iis (Microsoft Web server platform) 5, PHP (as the current mainstream development language) 4.4.0 run through
Page.php (as the current mainstream development language)
/*******************************************************************************
*sinoprise Function Classes
*copyright (c): 2006 Sinoprise Technology Lab
*
*unit Name:page.php (as the current mainstream development language)
*func:
*crate:shuguang Yin 2006-07-15
*******************************************************************************/
Class Sfc_page
{
Environment variables
/*var $Server;
var $Session;
var $QueryString;
var $Post;
var $Cookie;
var $Files;
var $Env; */
Page Control Properties
var $EnableViewState;
Page Properties
var $CharSet;//page character set
var $PageTitle;//title of the page
var $PageStyle;//style of the page
function Sfc_page ()
{
/*if (strcmp (substr (PHP (as now mainstream development language) _version,0,1), 4) >=0) {
$Server = $_server;
$Session = $_session;
$QueryString = $_get;
$Post = $_post;
$Cookie = $_cookie;
$Files = $_files;
$ENV = $_env;
}else{
Global $HTTP _server_vars, $HTTP _get_vars, $HTTP _post_vars, $HTTP _cookie_vars, $HTTP _post_files;
Global $HTTP _env_vars, $HTTP _session_vars;
$Server = $HTTP _server_vars;
$Session = $HTTP _session_vars;
$QueryString = $HTTP _get_vars;
$Post = $HTTP _post_vars;
$Cookie = $HTTP _cookie_vars;
$Files = $HTTP _post_files;
$ENV = $HTTP _env_vars;
}*/
$this->enableviewstate = false;
}
Occurs before a server state restore
function Pageinit ()
{
}
Occurs after a server state restore, but before a server-side event
function Pageload ()
{
}
Occurs after a server-side event is fired, but before anything is generated.
function Pageprerender ()
{
}
Occurs at the time the page is generated
function Pagerender ()
{
}
Occurs after web page generation is complete
function Pageunload ()
{
}
Display output
function Display ()
{
$this->pageinit ();
if ($this->enableviewstate) {
$this->decodeviewstate ();
http://www.bkjia.com/PHPjc/508644.html www.bkjia.com true http://www.bkjia.com/PHPjc/508644.html techarticle It is not possible to emulate ASP. NET (Microsoft's strongest development language) in PHP (the mainstream development language of the present) , especially in the case of PHP (which is now the mainstream development language) .