Re: Little trouble

From: Date: Mon, 06 Dec 2004 12:52:54 +0000
Subject: Re: Little trouble
References: 1  Groups: php.mirrors 
Request: Send a blank email to php-mirrors+get-26759@lists.php.net to get a copy of this message
Hi, Since this problem does not imply anything wrong, or any suggestion for php.net, this is not the proper address to write to. Please consult php-general@lists.php.net with support questions... Goba Sa írta:
Hi WebMaster, I ask you sorry if I wrote directly to you but I haven't found any reply to my question on newsgroup, sites & books. I would apprecciate if you can be so kind to give me some hints about how to solve that trouble. I'm going to explain it to you: ------------------------------# I have that script in php that should print on a page the result of lot of pages defined in this way: This is the address: www.mysite.com/mypage.php?idx=1&lines=50 It work in this way: if idx=1 and lines=50 my page will look like: element1 element2 .. element50 if idx=5 and lines=5 my page will look like: element5 element6 element7 element8 element9 Changing everytime the idx i have new pages so, thats are my variables: $idx = "www.mysite.com/mypage.php?idx="; idx_n=1; $lines="&lines=50"; I let the variable $lines still to 50 and i'll increase $idx_n of 50 for show all elements i need. do { $link = $idx.$idx_n.$lines; $idx_n=$idx_n + 50; $f=fopen($link,"r"); $data = ""; do {
    $stream = fread($f, 8192);
    if (strlen($stream) == 0) {
        break;
    }
    $data .= $stream;
} while (true); fclose($f); $data=substr($data,strlen($DontNeed),strlen($data)); $pos=stripos($data, $TillHere); $data=substr($data,0,$pos); here I clean the $data variable of things I don't need. echo $data; } while ($idx_n < 156700); My trouble is that this "do..while" never keeps all elements. Generally $idx_n break with value=1601 or 1301 but never show all elements and its like the script crash cause everything I can write after isnt' showed. I simply tried to write after "while" an echo "Its Done"; but isn't showed. And in the html file that is generated aren't printed neither the tags </body></html> for close the file. Simply it crash. Do you have some ideas about it? I would really apprecciate some words about it cause I'm not able to think at any solutions.. Just..that maybe is something with server? Isn't able to provide so fastly all requests? Best Regards Salvatore


« previous php.mirrors (#26759) next »