Use Php to simulate the asp.net page model. Simulating asp.net With php (as the mainstream development language) is unlikely, especially for php (as the mainstream development language) this method is unlikely to simulate asp.net With php (as the mainstream development language), especially for php (as the mainstream development language) this is even more difficult for object-oriented dynamic languages. in these cases, simulation means that we can use this example to understand the operating mechanism of asp.net (the most powerful development language of Microsoft ). the code is very simple. you do not need to elaborate on it. this test is run on win2000, iis (Microsoft's WEB server platform) 5, and php (as the mainstream development language) 4.4.0.
Page. php (as the mainstream development language)
/*************************************** ****************************************
* Sinoprise Function Classes
* CopyRight (c): 2006 Sinoprise Technology Lab
*
* Unit Name: page. php (as the mainstream development language)
* Func:
* Crate: Shuguang Yin 2006-07-15
**************************************** ***************************************/
Class SFC_Page
{
// Environment variable
/* Var $ Server;
Var $ Session;
Var $ QueryString;
Var $ Post;
Var $ Cookie;
Var $ Files;
Var $ Env ;*/
// Page control attributes
Var $ EnableViewState;
// Page properties
Var $ CharSet; // page character set
Var $ PageTitle; // The page title
Var $ PageStyle; // page style
Function SFC_Page ()
{
/* If (strcmp (substr (php (as the mainstream development language) _ VERSION,), 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 the server status is restored
Function PageInit ()
{
}
// Occurs after the server state is restored, but before the server event
Function PageLoad ()
{
}
// Occurs after a server event is triggered, but before anything is generated
Function PagePreRender ()
{
}
// When the page is generated
Function PageRender ()
{
}
// After the webpage is generated
Function PageUnLoad ()
{
}
// Display the output
Function Display ()
{
$ This-> PageInit ();
If ($ this-> EnableViewState ){
$ This-> DeCodeViewState ();
Simulation of asp.net (the most popular Microsoft development language) is unlikely, especially for php (as the mainstream development language) such a pair of targeting...