3
3
33balabol2016-07-19 23:58:53
Arduino
33balabol, 2016-07-19 23:58:53

Why is there no redirect from header("Location: https://site.ru");?

I transferred the site to the hosting and found that the redirect to another page stopped working through the following construction:

<?php
if (isset($_SESSION['auth_user']) && $_SESSION['auth_user']  == 'yes') {
?>

..Код страницы

<?php
}else
{
  header("Location: https://site.ru");
}
?>

By the way, when you go to such a page, just a blank page opens. The redirect is not happening.
https has nothing to do with it?

Answer the question

In order to leave comments, you need to log in

5 answer(s)
A
Alexander Gusev, 2016-02-14
@lolik123415

Alternative in China)
Don't forget to switch to eng language only. Auto-translation is evil))
On request "motor robot" You can find already assembled.
See also DC motor driver, sensors, etc.
I also advise you to visit public pages in VK that constantly post proposals for Chinese bulk , modules and other junk, sometimes interesting things slip through there, and you can also ask something, if not searched at all.
From ours, where the prices are not so bite, I can advise the chipster

E
evgeniy_lm, 2016-02-18
@evgeniy_lm

This is the "Chinese alternatives" only at the local price. Or buy in China (now this is not a problem) or look for a cheap one, it's big, it has everything. I, here, found uamper.com
In principle, you can make a cart for a robot yourself, the main thing is motors with gearboxes, you can take them from old toys

Дмитрий, 2016-07-20
@dmitryprogrammer

header это заголовок, они должны быть всегда перед любым выводом.

Алексей, 2016-07-20
@alsopub

Посмотрите заголовки в "Инструментах разработчика", посмотрите логи веб-сервера или php-fpm. Чего гадать то.
Скорее всего есть вывод, возможно BOM символ, если у вас UTF-8. Или перевод строки.

Андрей Павленко, 2016-07-20
@Akdmeh

There should be no spaces before <?php and no echo before the header function, check that.
But if it's really bad and you can't find it, in the very first file that is connected, enter ob_start (), this will include all echo entries in the internal buffer.
But this is bad practice if the pipes are on fire and the deadline for delivery is the day before yesterday. In a good way, you need to find what makes the output to the browser.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question