here is what i'm trying to do:

read file from www.somedomain.com/texts/text.php
file contain csv list of image names.
then i'm trying to loop trough to list and copy each file that doesn't exists on local machine to the local directory.

but i'm stuck in phase one, i can get content of that file, any ideas?

TIA

-t-

    right ... i can read manual so beginners, don't give me those links to manual.
    i have tried with every file function but no result, problem is on server end 'cause this works if i run this script on public web server and query from my own pc, but not vise versa.

      right ... i can read manual so beginners, don't give me those links to manual.

      You didnt state what you have tried, so naturally one can assume that you are a beginner to PHP who hasnt read the PHP Manual.

      Describe in detail (e.g. sample code snippets, relevant error messages) what you have tried and failed with.

        no offence laserlight, but quick look of amount of post's says something to those who are newbies in this forum... i hope. i'm so sick and tired answers that contains only "check manual"!

        i dodn't know how more i can explain this if i can't get any content of the file from server, but if i run same script on public server that reads content of file from my local pc, then it works ok.

        could this be somekind of proxy problem???
        please answer only if you have somekind of exerience of this kind of problem.

        TIA

        -t-

          Originally posted by laserlight
          You didnt state what you have tried, so naturally one can assume that you are a beginner to PHP who hasnt read the PHP Manual.

          Thank you, laserlight.
          Couldn't have said it better.

          BTW, my number of posts might be misleading.
          I got this username about a week ago, but I've been around here even longer than you guys as Dar-K. 😃

          i dodn't know how more i can explain this if i can't get any content of the file from server, but if i run same script on public server that reads content of file from my local pc, then it works ok.

          I'm not sure I understand 100%, but I'm interested in solving this.
          So you can read the list in your browser, but your local PHP can't read it?

            ok, i try to explain this one more time:

            Local server

            script.php **tries to get content of the www.xx.com/foo.txt
            foo.txt

            Public server

            script.php **tries to get content of the 82.82.82.82/foo.txt
            foo.txt

            1. if i run script from public server, i get content of the file
            2. if i run script from local server, i dodn't get content
            3. if i just type public address to url (www.xx.com/foo.txt) it's shown ok
            4. more strange things .. i can read (from public) and write content of image ex. blaah.gif and write it to local sever. But i can't do same thing with that text-file
            // IMAGE READ&WRITE
            $handle = fopen ('http://www.somedomain.com/site/content_images/0.gif', "rb");
            $contents = "";
            do {
                $data = fread($handle, 8192);
                if (strlen($data) == 0) {
                    break;
                }
                $contents .= $data;
            } while(true);
            fclose ($handle);
            
            $out = fopen("tempp/0.gif", "w");
            fwrite($out, $contents);
            fclose($out);
            
            
            // textfile read from public
            // THIS WORKS
            $fcontents = file ('http://82.181.xx.xxx/content.txt');
            while (list ($line_num, $line) = each ($fcontents)) 	{
               echo $line;
            }
            
            // THIS DOESN'T WORK
            $fcontents = file ('http://www.somedomain.com/content.txt');
            while (list ($line_num, $line) = each ($fcontents)) 	{
               echo $line;
            }
            

            -> dkruythoff, sorry about that, sometimes it's just frustrating when you have red whole day manual and books and then you got tip: read manual :rolleyes: :queasy:
            and yes it goes just like you said, can't read, but can see in browser

              What is the value of allow_url_fopen in your php.ini on the local server?

                Write a Reply...