How to connect remote desktop through php code

Discussion in 'PHP' started by sanjaygire, Dec 9, 2008.

  1. #1
    Hello,

    I need to connect to the remote computer through PHP code so that a valid user can use the printer and drives of remote computer.

    It would be great if anybody suggest the solution on the same

    Thanks,

    Sanjay
     
    sanjaygire, Dec 9, 2008 IP
  2. Kaizoku

    Kaizoku Well-Known Member

    Messages:
    1,261
    Likes Received:
    20
    Best Answers:
    1
    Trophy Points:
    105
    #2
    Use exec(); to send whatever commands the server use to print, I think need upload data as well.
     
    Kaizoku, Dec 10, 2008 IP
  3. JustAStranger

    JustAStranger Guest

    Messages:
    141
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #3
    php can not connect to a remote computer and exec will not help anything because exec executes stuff on the server and not the client.
    The only way to make php execute a remote session is by java or active objects.

    There are java terminals for VNC (vnc is a free remote desktop software), so you could embed a free java vnc applet into your website that autoconnects to your remote desktop.
     
    JustAStranger, Dec 10, 2008 IP
  4. sanjaygire

    sanjaygire Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Thanks for response.

    I have tried below sock function to connect the remote computer through WWW service.

    It is showing connected and printed out the response.Please suggest the changes in below code, so I can

    access the remote computer. Below is the code i'm using,

    $service_port = getservbyname('www','tcp') ;
    $address = gethostbyname($target_host);

    $socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);

    $result = socket_connect($socket, $address, $service_port);
     
    sanjaygire, Dec 10, 2008 IP