Maintenance mode | Sololearn: Learn to code for FREE!


Maintenance mode

<?php function maintenance($mode = FALSE){ if($mode){ header('Location:'); exit; } else{ header('Location:'); exit; } } ?> How can I add maintenance true show this page maintenance.php Like this include('maintenance.php')

3/20/2020 8:50:29 AM


5 Answers

New Answer


I didn't understand your question clearly. What is it exactly that you want to do? explain clearly please ...


Did that someone give you a code example? I think you can ask for that if there is something unclear. If you mean to show *This page under construction* then I guess your code is already set correctly. Just redirect to a page showing that message (maintenance.php), otherwise, redirect to site base directory (usually means to load index.php). You don't need `include`, `require` or `require_once` anymore because the redirection had taken care of that, if I understood what you mean ...


Then, if you wish to enter maintenance mode, just add the following line after the require_once line. maintenance(TRUE);


I mean someone told me to use if I want to go maintenance mode use this maintenance (true) before require_once ('maintenanc.php');


How I go about it