CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Join Date
    Mar 2002
    Location
    China
    Posts
    53

    Question Can php open a txt file on other computer?

    If can, how to do?

  2. #2
    Join Date
    Oct 2002
    Location
    Right Behind you
    Posts
    238
    no


    "3 out of every 4 people make up 75% of the population"
    ---------------------------------------------
    "If the World didn't suck, we would all fall off"
    ---------------------------------------------
    "No pancake is so flat that it doesnt have two sides"
    ---------------------------------------------

  3. #3
    Join Date
    May 2003
    Location
    Denmark
    Posts
    1,315
    Well that sort of depends.

    If the other computer makes the file accessible, in a way that the php server can access it, then yes it is quite possible.

    If the file is on a http server on another computer you can read it much like any other file

    http://www.php.net/manual/en/function.file.php

    Alternativly, you could put the file in a shared folder on the remote computer, and then mount the folder as a network drive on the computer that runs the php server.
    The biggest problem encountered while trying to design a system that was completely foolproof,
    was, that people tended to underestimate the ingenuity of complete fools.
    Douglas Adams

  4. #4
    Join Date
    Oct 2002
    Location
    Right Behind you
    Posts
    238
    okay okay okay its possible...

    but there aren't that many legitimate reasons for it, so i was telling him no.

    what you need to do is make a link basically to open the text file, place the contents of the file into a textarea, and then save it.

    that may seem like *well duh*... but...

    well, anyway, you need to put a file editing script on the computer you want to edit the file from, otherwise your asnwer is (legit.) no
    "3 out of every 4 people make up 75% of the population"
    ---------------------------------------------
    "If the World didn't suck, we would all fall off"
    ---------------------------------------------
    "No pancake is so flat that it doesnt have two sides"
    ---------------------------------------------

  5. #5
    Join Date
    Mar 2002
    Location
    China
    Posts
    53
    I have tested that php can not put the file in the folder as a network drive on the computer that runs the php server.

  6. #6
    Join Date
    May 2003
    Location
    Denmark
    Posts
    1,315
    Exactly what did you do ?, and what are you trying to achive ?
    The biggest problem encountered while trying to design a system that was completely foolproof,
    was, that people tended to underestimate the ingenuity of complete fools.
    Douglas Adams

  7. #7
    Join Date
    Nov 2003
    Location
    Wash DC burbs
    Posts
    16
    http://www.m-tecs.net/?a=products&b=pwe

    I'm not a PHP scripter, but this maybe an option.. this same topic came up in another forum I visit.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured