Jump to content

royrules22

Members
  • Posts

    11
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

royrules22's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. IP address of the machine running the code or the machine in which the files reside? I'm assuming the latter right?
  2. Full directory path as in? I'm confused sorry. Windows Server 2003 BTW.
  3. Hi, I need to access files on a Windows network. So basically the location would be \\server\dir1\dir2 or something like that. I'm running this PHP script on a different server (call it serv2) that runs IIS. My code is something like this: $dir = "\\server\dir1\dir2"; if (is_dir($dir)) { echo "IS DIR!\n"; if ($dh = opendir($dir)) { /*More stuff*/ It doesn't even recognize it as a directory. Now I figure the problem is authentication. Basically all users in a domain (call it 'allusers') can access server and these files. But the scripts in serv2 (the one where PHP runs) is authentication anonymously using the account ISUR_SERV2, which is an account local to the serv2 server and not in the domain 'allusers'. So I tried authenticating just this script using an account in the allusers domain (my own). However it still doesn't work. And I know for a fact that serv2 is connected to the network. Any help? Thanks
  4. Thanks! It was read-only. I went into the CP (not Plesk just some other custom one). I added write permission onto that file so it works now. But I just have to figure out how to set permission to only one file rather than a directory.. Still don't know why is_writeable worked..
  5. This is annoying. I can't write to files when fopening them with w, w+, a or even a+. My or exit() statement is excuted instead. However when I open it via r mode it works fine. So I assume it has problems writing. But is_writeable() return true! What in the world can be happening? This is a Windows IIS server so I cannot chmod it, and nor can I ask the admin to change it. Any solutions?
  6. Anyone else? Sorry for the second bump.
  7. Hmm.. That would be a valid solution, but I still can't get over the fact that there's a lot of unnecessary extra resources being used (in this case the temp file). Isn't there a way to just seek to the link # and insert there?
  8. Wouldn't it be eaiser to use $_GET["id"] instead? Or am I just saying stupid stuff?
  9. Hi, This is my first time here, and I wish I found this place earlier. In any case I'm a begginner at PHP. I used to code almost daily last year, however due to school and other issues I'vent touched PHP in over 6 months. And now I need to make a script (in a few days no less), and I'm stumped on this issue. This script will recieve data from a form and format it. Than it will open up an HTML form, go to a specified line and insert the formatted input there. (Basically a news script designed around the website, rather than otherway which I would've preffered). My solution was to read the entire file into an array using file(), opening up the file in "w" mode (in effect erasing the entire thing), write array from begginning to line "x" onto file, write the formatted ouput, and than finish writing the rest of the array. Close file. This works, however I dislike having to load a huge file onto an array (about 40Kb and will grow), and than writing back from the array line by line. My question is if there a better way to solve the problem? As in is the a way to just navigate to line x and than write there instead of having to load the stuff into an array? I thought of opening in a+ mode, fseeking to the position and writing. However I seem to remember reading somewhere that it will ALWAYS write to the end of the file if opened in append mode. Thanks for the help. Oh and the server is an IIS not Apache which I am more comfortable with..
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.