E
E
ErkRain2018-02-08 13:56:45
Web development
ErkRain, 2018-02-08 13:56:45

Site down?

How can I make it so that when I click the button in the admin panel that I made, the index.html file is renamed to index1.html and the file that was called index2.html is renamed to index.html ?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
O
Oleg, 2018-02-08
@402d

write a controller in php that will handle the click of this button.
and God forbid you press the button twice ;)
Andekostraction is done wrong.
the entry point remains unchanged. The state of the site is checked (by querying the database to the site settings table). And a stub is displayed or execution follows the usual path.
well, if you play with renaming,
then copy the worker to index.html
and the second method is to copy the stub to index.html
But as you want - this INVITATION TO HACKING. Files with chmod 777 or simply writable from Apache - how to leave keys in the keyhole of an apartment.

B
Boris Korobkov, 2018-02-08
@BorisKorobkov

RTFM php.net/manual/ru/function.rename.php

V
Vladimir Dubos, 2018-02-08
@vovaduba

Isn't it easier to make a special entry somewhere in the database and, when displaying the page in php, decide whether to display the page or the inscription "Site is down"?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question