How to intercept HTTP requests in PHP-php Tutorial

Source: Internet
Author: User
How can I intercept HTTP requests in PHP? For example, if the request file name is my. do, it will be transferred to my own processing function. Content returned to the browser, which can be written by myself in this function. If it cannot be done in php, it can be done in apache. In APACHE, I assume that it redirects to a function in my own library file. ------ Solution ------------------ $ _ SERVER [PHP_SE how can I intercept HTTP requests in PHP?
For example, if the request file name is my. do, it will be transferred to my own processing function. Content returned to the browser, which can be written by myself in this function.

If it cannot be done in php, it can be done in apache. In APACHE, I assume that it redirects to a function in my own library file.

------ Solution --------------------
$ _ SERVER ['php _ SELF '] can be used to obtain the file name of the script being executed.
You can control the output content on your own.
------ Solution --------------------
Start from. What you said is too vague,

For example, AJAX

And
JSP can use the xmlrpc package of APACHE to send HTTP signals + XML to PHP. PHP processes the XML returned through HTTP
------ Solution --------------------
Url rewrite
------ Solution --------------------
Php does not have this type. php OO is not very strong. You need to configure the server or use the. htaccess file to forward all requests to index. php. Then, perform the next step based on predefined variables such as REQUEST_URI.
------ Solution --------------------
Discussion

Start from. What you said is too vague,

For example, AJAX

And
JSP can use the xmlrpc package of APACHE to send HTTP signals + XML to PHP. PHP processes the XML returned through HTTP

------ Solution --------------------
Check the $ _ SERVER Manual
------ Solution --------------------
Speaking of url rewrite, refer to the 7 th Floor,

Send to my. Do requests are forwarded to your own PHP file to read data, and then processed in different places based on the data.
------ Solution --------------------
Discussion

Speaking of url rewrite, refer to the 7 th Floor,

Send to my. Do requests are forwarded to your own PHP file to read data, and then processed in different places based on the data.

------ Solution --------------------
Discussion
Files like my. do not exist.

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.