Results 1 to 4 of 4

Thread: help in php

  1. #1

    Question help in php


    here's the scenario:

    i want to create a file to a client pc, i use fopen to create a file.
    my problem is, access denied since apache has no permission...

    how do i log on or connect to client pc using php?
    provided i know the username and password to that pc....


    Code:
    $loc="\\\\mm114\\c\$\\test1.txt"; //i made this constant for testing....
    
    
    $fh = fopen("$loc", "w"); //CREATE FILE and write file
    
    if($fh==false)
    	die("unable to create file");
    else
        print("file created");
    
    fclose($fh);
    P.S. without changing the httpd.conf in the apache user and group.

  2. #2
    have you tried chmod()? Try setting the permission of the file so that you can access it.

  3. #3
    Based on $loc, I guess your server is running Windows.

    PHP may not be able to write to samba shares location directly.
    You could mount the client share using "net use x: \\client\c\" then use the fullpath with drive letter to write the file. Like $loc="x:\test1.txt".

    With linux/unix use "mount".

  4. #4
    thanks...i solve my prob..i just downloaded d file from d server....its not d wat i wanted, bt it save's me a lot of headache...

  5.    Advertisement

Similar Threads

 
  1. help, im stuck! in PHP programming.
    By emailroy2002 in forum Programming
    Replies: 16
    Last Post: 07-08-2010, 11:43 PM
  2. help in printing using php
    By ingkiang in forum Programming
    Replies: 5
    Last Post: 11-13-2008, 08:18 PM
  3. Replies: 12
    Last Post: 10-30-2008, 01:24 PM
  4. Replies: 33
    Last Post: 10-17-2008, 04:09 PM
  5. Streaming/Playing videos in PHP..help.
    By ichiriki in forum Programming
    Replies: 3
    Last Post: 10-08-2008, 05:15 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
about us
We are the first Cebu Online Media.

iSTORYA.NET is Cebu's Biggest, Southern Philippines' Most Active, and the Philippines' Strongest Online Community!
follow us
#top