www.webdeveloper.com
Results 1 to 4 of 4

Thread: Bat into php!

  1. #1
    Join Date
    Aug 2012
    Posts
    2

    Bat into php!

    Hi everyone!

    First of all im new to this forum and also new regarding bat/php things , so i hope someone here can be at help. Im trying to help out other people with easy install of a hardware defined key to their pc.

    what i got is this in a bat file:

    @echo Date: %DATE% Time: %TIME% User: %USERNAME% Hostname: %COMPUTERNAME% OS: %OS% CPU: %Processor_Identifier% CPU Arch: %Processor_Architecture% Cores: %Number_Of_Processors% CPU Rev: %Processor_Revision% CPU Level: %Processor_Level% Key: %RANDOM%%RANDOM%%RANDOM%%RANDOM%%RANDOM%%RANDOM%%RANDOM%%RANDOM% >>myhardwarekey

    i need this integrated into a php page with a button so when they press the button they download the hardware made key to a specific folder or a user defined folder.
    Example:

    C:/program files/my program

    i found this on the internet:

    <?php
    if(isset($_POST['submit']))
    {
    echo exec('start.bat');
    echo "Done!";
    } else {
    // display the form
    ?>
    <form action="" method="post">
    <input type="submit" name="submit" value="DO IT!">
    </form>
    <?php
    }
    ?>

    if thats of any kind of help?


    Regards Odin

  2. #2
    Join Date
    Jul 2003
    Location
    Lansdale, PA
    Posts
    88
    The "exec" in the sample script you posted will execute on the server, not the customer's machine. I don't know exactly what you are trying to do, but if you have a limited understanding of php, you might be better off looking for a program already written to handle downloads.

    -Jim

  3. #3
    Join Date
    Aug 2012
    Posts
    2
    Quote Originally Posted by jimr451 View Post
    The "exec" in the sample script you posted will execute on the server, not the customer's machine. I don't know exactly what you are trying to do, but if you have a limited understanding of php, you might be better off looking for a program already written to handle downloads.

    -Jim
    i just found out about that yesterday

    what i need it to do is to execute the bat file or maybe a php script, so it takes hardware info from the client pc and saves this into a key (fil) on the client pc, this prefered also with userdefined option on where to save the key. I have looked about everywhere for a solution for this but without any luck (actually used 6+ hours on it yesterday) , thats why im asking in this forum since many of you are pro´s regarding issues like this

    Regards Odin

  4. #4
    Join Date
    Jan 2009
    Posts
    3,346
    Quote Originally Posted by odinthorfreja View Post
    i just found out about that yesterday

    what i need it to do is to execute the bat file or maybe a php script, so it takes hardware info from the client pc and saves this into a key (fil) on the client pc, this prefered also with userdefined option on where to save the key. I have looked about everywhere for a solution for this but without any luck (actually used 6+ hours on it yesterday) , thats why im asking in this forum since many of you are pro´s regarding issues like this

    Regards Odin
    Won't happen with PHP (unless the user has PHP installed in their machine and runs your script themselves). Try Java or some other client application language.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles