Object 1) Write HTML
Asp:Response.Write (str)
Php:print $str;
Echo $str;
Print_r $debug _str;
2 Form, Cookie and querystring variable
asp: You can use the Request object.
PHP: These variables are automatically provided as a global variable, if configured in the php.ini file:
Variables_order= "Egpcs"
Register_globals=on
For security, I will not allow register_globals (set it to off). The variables are then used only in the array:
$HTTP _post_vars, $HTTP _cookie_vars and $HTTP _get_vars.
3) redirecting to another location
Asp:Response.Redirect (URL)
Php:header ("Location: $url");
4) Cookie Processing
Asp:Response.Cookies (cookiename) = newval
Avar = Request.Cookies (cookiename)
Php:setcookie ($cookiename, $newval);
$avar = $HTTP _cookie_vars[$cookiename];
5) Application variable
Asp:application (Appvarname)
PHP: Not available, can be modeled using a database
6) Session Variable
Asp:session (sessionname) = newval
Avar = Session (sessionname)
PHP: In PHP4 or later versions, we determine variables as a session in the
Session_register ($sessionname), and then we call Session_Start ()
Restores the session variable value at the beginning of the. PHP page that is used.
For example:
Session_register (' Avar ');
$avar = 99;
Session_Start ();
Print $avar;
7) Form Variable
Asp:Request.Form ("Formvar")
Request.QueryString ("GetVar")
PHP: $HTTP _post_vars["Formvar"];
$HTTP _get_vars["GetVar"];
The Get and POST variables can be automatically modified to PHP variables alternately, which is an unsafe method.
8) Server Variable
asp: There are many server variables that can be viewed in ASP documentation. An example:
Request.ServerVariables ("Http_host")
PHP: As ISAPI mode, the server variables are stored in the $http_server_vars array.
As CGI, they are stored in environment variables, with $http_env_vars arrays or getenv ()
Can get. An example:
$HTTP _server_vars["Http_host"] using ISAPI module
$HTTP _env_vars["Http_host"] using CGI module
9) Database access
asp: General use ADO Technology
Php:ado can use the ADODB library to simulate, this library is equivalent to ADO.
The limit is that the read-only cursor and the forward-scrolling cursor are currently supported.
(note) can also call the COM library directly, see my article.
Buffering)
Asp:Response.Buffer = True
Response.Write ("abc");
Response.Flush ()
Php:ob_start ();
print "ABC";
Ob_end_flush ();
One) Script Timeout
asp: The time level is the second level:
Server.ScriptTimeout (240)
PHP: The time level is the second level:
Set_time_limit (240);
The above translation is not good, please forgive!