Home > Backend Development > PHP Tutorial > 请问:关于判断网站是否关闭

请问:关于判断网站是否关闭

WBOY
Release: 2016-06-13 11:07:00
Original
1470 people have browsed it

请教:关于判断网站是否关闭
如果网站的服务器需要维护,当网站进行维护时,怎么用代码来判断网站是否在维护,如果在维护的话跳转到提示“服务器正在维护”页面??不甚感激
------解决方案--------------------
在文件或数据库中置一个标识,在网站头部加判断,如果标识为真显示维护状态中。否则正常访问
------解决方案--------------------
a.php

<br /><? $maintance = true; ?><br />
Copy after login


其他php
<br />include a.php<br />if ($maintance) header(...)<br />
Copy after login

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template