Execute .exe via PHP

Discussion in 'PHP' started by Zenaro, Feb 26, 2013.

  1. #1
    Hello,

    I'm new here on the forum and have a question to execute a file on the computer via PHP.

    She wanted to stay the same button "START GAME" like this site " csonline.nexon.com "

    In this example, it can run the file, regardless of where it is installed. I believe that it accesses your computer registry to find this information.

    Could help me?
     
    Zenaro, Feb 26, 2013 IP
  2. sarahk

    sarahk iTamer Staff

    Messages:
    28,898
    Likes Received:
    4,555
    Best Answers:
    123
    Trophy Points:
    665
    #2
    I would expect the browser to protect users from that kind of thing. You'd need to use a browser plugin to make that happen - which means its not PHP.

    Example: I use Strava and when I hook up my Garmin device the browser can access that data but I've already given permission to the plugin/app thing that does the work.
     
    sarahk, Feb 26, 2013 IP
  3. Argento

    Argento Active Member

    Messages:
    69
    Likes Received:
    2
    Best Answers:
    1
    Trophy Points:
    53
    #3
    I used a native php function to execute .exe files when i was developing a remote managment web for a game server.

    Try this:

    http://us2.php.net/manual/en/ref.exec.php
    http://us2.php.net/manual/en/function.exec.php

    If the file it is not in the server, you can execute a file that comunicates with the real host.
     
    Argento, Feb 26, 2013 IP
  4. sarahk

    sarahk iTamer Staff

    Messages:
    28,898
    Likes Received:
    4,555
    Best Answers:
    123
    Trophy Points:
    665
    #4
    I read his question to mean that he wanted to run a file on the user's computer not the server. Zenaro - can you confirm your requirement please.
     
    sarahk, Feb 26, 2013 IP
  5. Zenaro

    Zenaro Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #5
    Yes sarahk, exactly!

    Is that my friends and I are developing a game, but how we use a MySQL server without support external connections, that would be the only way to "make authentication" in the game.
    That would be temporary, until we change the Host.

    Do not know if you access the link that went above ( http://csonline.nexon.com/Contents/main/index.aspx ), There they have a button "START GAME" which does exactly what I want. Runs wherever installed game, regardless of where you installed.
     
    Zenaro, Feb 26, 2013 IP
  6. sarahk

    sarahk iTamer Staff

    Messages:
    28,898
    Likes Received:
    4,555
    Best Answers:
    123
    Trophy Points:
    665
    #6
    I clicked on it but the Korean translation wasn't too helpful and I'd need to create an account.

    Can't you just use cookies for authentication?
     
    sarahk, Feb 26, 2013 IP
  7. Zenaro

    Zenaro Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #7
    It would not take one account, was more to model, but if you want, we have a test account "csobr2012" for login and password.

    But to run the game, it needs to be installed.

    I thought about that possibility, but would have to move the game system, I think it would be for a future.

    From what I saw from the windows registry on this game, they have an entry "executable", I think it is from running the game.

    Any idea how I can do the same?

    Even if it is through another language.
     
    Last edited: Feb 26, 2013
    Zenaro, Feb 26, 2013 IP
  8. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #8
    I didn't check the site, but I'm pretty sure they're using a custom protocol (scheme).

    Basically, you register your app as default handler for a certain scheme. Google for "windows protocol activation" or similar.
     
    nico_swd, Feb 27, 2013 IP
  9. Zenaro

    Zenaro Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #9
    I think i can't create a custom protocol, since the site is hosted in a shared environment.
     
    Zenaro, Feb 27, 2013 IP
  10. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #10
    No, the .exe you want to run needs a custom scheme. From your site you would just link to it:

    
    <a href="myapp://init">Open app</a>
    
    HTML:
    It doesn't matter where you host your site.
     
    nico_swd, Feb 27, 2013 IP
  11. Zenaro

    Zenaro Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #11
    I host in Hostinger..

    Sorry, i look for something else here. I saw another link and I'll try at home when i arrive.
    If this works, I will post here
     
    Zenaro, Feb 27, 2013 IP
  12. yenerich

    yenerich Active Member

    Messages:
    697
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    75
    #12
    You need some custom browser or register the schemne, like http:// ftp://.... well, you need to register your own then you can run your executable via as link.
    Ofcourse it will only works in a computer where you previously creatre you own myapp://
     
    yenerich, Feb 28, 2013 IP
  13. Zenaro

    Zenaro Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #13
    It worked!

    Not exactly how the site I spent, but for now will be like. Thank you!
     
    Zenaro, Mar 2, 2013 IP