It is unlikely to use php to imitate asp.net. especially for dynamic languages with incomplete object-oriented support such as php, it is even more difficult. in these cases, imitation means that we can use this example to understand the operating mechanism of asp.net.
It is unlikely to use php to imitate asp.net. especially for dynamic languages with incomplete object-oriented support such as php, it is even more difficult. in these cases, imitation means that we can use this example to understand the operating mechanism of asp.net. (Furthermore, it is just a model ). the code is very simple and you do not need to elaborate. this test passes through win2000, iis5, and php 4.4.0.
Page. php
/*************************************** ******
* Sinoprise Function Classes
* CopyRight (c): 2006 Sinoprise Technology Lab
*
* Unit Name: page. php
* 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_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;
}
// Before the server status is restored
Function PageInit ()
{
}
// Generated after the server state is restored, but before the server event
Function PageLoad ()
{
}
// After a server event is triggered, but before anything happens
Function PagePreRender ()
{
}
// Generated at the time of natural Page
Function PageRender ()
{
}
// After the webpage is created
Function PageUnLoad ()
{