Home php Simple pages reboot. PHP

Simple pages reboot. PHP




There is a code like this.

$ Condition = ...
  if ($ Condition) {
   Reloading page.

But as I did not try, I can not restart the page, Header does not work if I use the script page reboots forever, Ajax do not know.
Help please solve the problem. Thanks.

Answer 1

Header should work, see if you wrote everything correctly, and the Header is sent with the headers, that is, the first of everything, it should not be outputing any content as well as HTML tags. You can also declare a condition in a variable, you can declare the variable following the condition, for example:

if (1 == 1) {
$ result = value;
} else {
$ result = false;
Header ("Refresh: 0");

Be sure to header must be before the content reading

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions