52 users online (0 members and 52 guests)  


  Results 1 to 5 of 5

Related

  1. Open url in new tab/window, Facebook tab    Forum: General Discussion
    Replies: 0
  2. Open dropdown menu links in New Windows    Forum: Website Scripts Forum
    Replies: 1
  3. xhtml open in new window ?    Forum: HTML Forum
    Replies: 1
  4. Open New Window from Menu    Forum: Javascript Forum
    Replies: 6
  5. open without new window    Forum: Javascript Forum
    Replies: 5
  1. #1
    ramki067's Avatar
    New User

    Status
    Offline
    Join Date
    Oct 2007
    Posts
    22

    How to open Windows command window from php?

    Hi,
    I've gone through the manual and i didn't get on how to open Windows XP command window from php. Need help in this regard.Please.

    Regards,
    Ramki.

  2. #2
    rangana's Avatar
    Moderator/Allstar

    Status
    Offline
    Join Date
    Feb 2008
    Location
    Cebu City Philippines
    Posts
    317

    Re: How to open Windows command window from php?

    I thought it's in the manual. Take a look on the exec() function.
    See if it helps

  3. #3
    ramki067's Avatar
    New User

    Status
    Offline
    Join Date
    Oct 2007
    Posts
    22

    Re: How to open Windows command window from php?

    I've done using exec command but nothing happens!
    Code:
    <?
    $command = 'cd C:\Program Files\Apache Group\Apache2\htdocs'; 
    
    echo exec($command);
    
    $command1 = 'perl playback_v15.pl'; 
    
    ?>
    <INPUT type="submit" value="Run Automation" onclick="<?php echo exec($command1); ?>" />
    When i clicked the Run Automation button nothing happens!!!

  4. #4
    rangana's Avatar
    Moderator/Allstar

    Status
    Offline
    Join Date
    Feb 2008
    Location
    Cebu City Philippines
    Posts
    317

    Re: How to open Windows command window from php?

    Your code is erroneous. It should be:
    Code:
    $command = 'cd "C:\Program Files\Apache Group\Apache2\htdocs"';

    I just thought that the script might be errorneous. The script will run on display and not onclick.
    ..and onclick is a javascript event. better catch the action in server side. Then maybe you can use exec('perl play.pl');
    Hope made some sense

  5. #5
    ramki067's Avatar
    New User

    Status
    Offline
    Join Date
    Oct 2007
    Posts
    22

    Re: How to open Windows command window from php?

    Quote Originally Posted by rangana View Post
    Your code is erroneous. It should be:
    Code:
    $command = 'cd "C:\Program Files\Apache Group\Apache2\htdocs"';

    I just thought that the script might be errorneous. The script will run on display and not onclick.
    ..and onclick is a javascript event. better catch the action in server side. Then maybe you can use exec('perl play.pl');
    Hope made some sense
    Thanks. I just need to open a command window and execute the "perl run.pl" command thats all. The form after i click the button should go no where. How to achieve this or is there any other way so that i can open a command window and run the perl script? I'm a newbie so please guide me.



Tags for this Thread