Google Chrome version - 25.0.1364.172 m
The principle of operation is as follows:
- User visits the page (script number 1)
- He is running
- After this, the header is sent (redirect to script №2)
- Script number 2 takes the baton
- Performed
- Returns the baton to the script number 1 and the script number 1 shows the result
The problem is the protection of the browser. If I make headlines, I get error 310. And if I try to finish the work of script No. 2 by outputting javascript code or a refresh meta tag to the browser, the browser simply loops to refresh the page (script No. 2), even if it is specified that you need to redirect to another subdomain , not to mention another directory of the same domain. Redirects only if the destination domain is completely different.
Does anyone have any idea what could be the reason for this strange behavior of the browser? And what to do? It is necessary that the principle of the relay worked in all browsers.
UPD
Why is the code here if the question is not about the code? Anyway. Code like this:
script1.php
<? header ("Location: script2.php"); exit(); ?>
script2.php
<? header ("Location: script1.php"); exit(); ?>
Only the whole point is that in the first script the condition first goes, and if it is not met, then the second script goes to the second script that enters the necessary data into the database and when the second script completes its work, the request to the first script should be repeated, in which the condition will already be met (due to the work done by the second script) and, accordingly, the first script will no longer refer to the second script and will perform completely different actions not related to redirects.
UPD2
script1.php
<? Если переменная $_SESSION['category'] == '2' то выводим слово "БДСМ", а если нет, то делаем редирект на второй скрипт header ("Location: script2.php"); exit(); ?>
script2.php
<? $_SESSION['category'] = '2'; header ("Location: script1.php"); exit(); ?>
A simple example with a session variable. Well, now everyone understands the logic? :))) I understand that you can do everything in one script and it will work fine, but I’m wondering if it is possible to somehow distribute duties to different scripts so that they work on the principle of transferring an estefetnoy stick, or, as it were, played "CIFU" until a certain moment. :) I don’t already know how the boys explain what I want to achieve from Google ChromA. :)))))
UPD 3
What I gave as an example - I did not test and it works yes, but for some reason, when two real big scripts work, glitches or errors described above occur and only in Google Chrome, although there is nothing special in the scripts and in a general sense they are logically folded in the same way as my session example, only the scripts work with the database and don’t transfer anything to each other, but the first one says to the second one - “I don’t have data, work on you too”. I will not apply the code, because my conscience will not allow me to ask anyone to figure it out. :)))
Sorry for the "ghost hunt." :) Thank you all, especially @eicto and my friend @ReinRaus . :)))