Answer the question
In order to leave comments, you need to log in
What could be the reason for incomplete loading of a page with a loop?
Hello dear experts!
I ran into a very peculiar problem and I can’t understand why the following situation occurs:
There is a web service for clients that is hosted on its own server:
Debian 6 Squeeze 64 bit ,
apache2-mpm-itk-2.2.16-6+squeeze12 ,
php5 -5.3.3-7+squeeze19 .
On the main page of the web service in php, certain actions are performed (the foreach loop in which the curl is called) when the form is submitted. Each time a different amount of data is sent via post, but in total there are no more than 20 iterations in the loop.
The code looks like this:
<div>Блок до цикла</div>
<?php
foreach ($_POST['account'] as $account_id) {
$str = getPage($account_id); // ВЫЗОВ CURL ЧЕРЕЗ ФУНКЦИЮ
}
?>
<div>Блок после цикла</div>
<div>Блок до цикла</div>
<?php
foreach ($_POST['account'] as $account_id) {
echo "\r\n"; // ПРИ ДОБАВЛЕНИИ ЭТОЙ СТРОКИ БЛОК ПОСЛЕ ЦИКЛА ОТОБРАЖАЕТСЯ
$str = getPage($account_id); // ВЫЗОВ CURL ЧЕРЕЗ ФУНКЦИЮ
}
?>
<div>Блок после цикла</div>
Answer the question
In order to leave comments, you need to log in
Try replacing "professional insert" with normal output using echo.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question