_php tutorial for simulating ASP. NET page model with PHP

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

  • Related Article

    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.