Home >Backend Development >PHP Tutorial >A small example of php http protocol application
In the process of learning PHP programming, it is recommended that you understand the relevant knowledge of the HTTP protocol. Here are two small examples for your reference.
The following are two examples of the php http protocol. Friends in need can refer to them. 1. Control the browser to jump at a certain time through http response. <?php //通过http响应,控制浏览器在一定时间跳转 //3秒 浏览器跳转到指定url //header("Refresh: 3; url=http://bbs.it-home.org"); header("Refresh: 3; url=http://localhost/htdocs/test.php"); ?> 2. Set to disable caching, which can be viewed through the httpwatch packet capture tool. <?php //禁用缓存 header("Expires: -1"); header("Cache-Control: no-cache"); header("pragam: no-cache"); echo "禁用缓存"; //by bbs.it-home.org ?> |