Use Php to simulate the asp.net page model

Source: Internet
Author: User
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 ()
{

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.