SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: exec

  1. #1
    SitePoint Member
    Join Date
    May 2007
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Exclamation exec

    Hello All . . .

    I need some help about exec command.


    I have create an executable that return the System Drives. It is based
    on DOS and does not need any parameter.


    I have create my php script that executes the executable i've create
    and the source code is the following :


    ##########################################
    php:


    exec("SystemDrives", $out);


    for($i = 0; $i <= sizeof($out)-1; $i++)
    {
    echo $out[$i];
    execMediaID($out[$i]);
    echo "<br />";



    }


    ##########################################

    The php script is in the followin directory :


    http://localhost/My Application/Applications/SystemDrives.php


    in the same directory is and the executable


    http://localhost/My Application/Application/SystemDrives.exe


    The problem is that if i will call the SystemDrives.php from parent
    directory then i don't get any result.


    For example if i will execute the following script i don't have any
    result


    php:
    index.php
    <?php
    include_once("Applications/SystemDrives.php");
    ?>


    that the index located in the following directory


    http://localhost/My Application/index.php


    What can i do to execute the directories.
    ---------------------------------------------------------------------------*---------------------------------------------------------------


    Thanks a lot . . .

  2. #2
    Non-Member
    Join Date
    Feb 2006
    Posts
    49
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i don't know from where you try to include your file but try this

    PHP Code:
    <?php 
    include_once("/Applications/SystemDrives.php"); 
    ?>
    OR

    PHP Code:
    <?php 
    include_once("../Applications/SystemDrives.php"); 
    ?>
    OR

    PHP Code:
    <?php 
    include_once("../../Applications/SystemDrives.php"); 
    ?>


Bookmarks

Posting Permissions

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