How to control my computer with PHP

I phone app has something to do with it

Page 1 of 1

10 Replies - 4423 Views - Last Post: 12 November 2010 - 01:52 PM Rate Topic: -----

#1 youbob1212  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 16
  • View blog
  • Posts: 132
  • Joined: 31-October 10

How to control my computer with PHP

Posted 12 November 2010 - 10:07 AM

Greetings,

I been having some problems finding the solution to this question; "How to use PHP to control your PC.". Such as send your computer to Shutdown, Restart, Standby, to load programs, and to close programs if open.

This is done remotely. I have an IPhone app that is call PHP Getter 1.0
It's a free app, and I think it does work, but there isn't enough instructions on how to use it.. No example codes or anything.

So this is what it does. You will have a URL bar within this app, you type in the address of your PHP server. In the graphic area of this app, you have 6 buttons, every time you hit one of these buttons. The program will call out like this:

page.php?button=Button1
Button1 up to 6 can be called.

So how to set a php server up is no big deal. All I have to do is find a free web host that supports PHP, and type in the code.


So here are my question.
1. Can anybody show me how to use PHP to Shutdown, Restart, Standby, to load programs, and to close programs if open, through this app?

I run windows XP, and any links or example code would be great!

Thank you for your time. ^^

Oh the PHP Getter can be found FRee in the Iphone store.

This post has been edited by youbob1212: 12 November 2010 - 10:08 AM


Is This A Good Question/Topic? 0
  • +

Replies To: How to control my computer with PHP

#2 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3490
  • View blog
  • Posts: 10,058
  • Joined: 08-June 10

Re: How to control my computer with PHP

Posted 12 November 2010 - 10:15 AM

View Postyoubob1212, on 12 November 2010 - 05:07 PM, said:

So here are my question.
1. Can anybody show me how to use PHP to Shutdown, Restart, Standby, to load programs, and to close programs if open, through this app?

why would you do that? PHP is a server-side language, as such it has no interaction with the client computer (besides exchanging text) and while you can issue shell commands to the server, no hosting company will allow you to do that (by denying permission)
Was This Post Helpful? 0
  • +
  • -

#3 creativecoding  Icon User is offline

  • Hash != Encryption
  • member icon


Reputation: 926
  • View blog
  • Posts: 3,204
  • Joined: 19-January 10

Re: How to control my computer with PHP

Posted 12 November 2010 - 10:18 AM

PHP is server-side code. So, you cannot actually shut down your computer. There are two ways you can do this though.

1. Create a PHP emailer and then follow this tutorial: <Removed link to hacking site>

2. Create a php script that outputs 1, 2, or program. 1 being shutdown, 2 being logoff, and program for starting programs. Then create a script on your computer that automatically gets the source of the web page, and then do the correct function.

This post has been edited by macosxnerd101: 12 November 2010 - 10:23 AM

Was This Post Helpful? 0
  • +
  • -

#4 youbob1212  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 16
  • View blog
  • Posts: 132
  • Joined: 31-October 10

Re: How to control my computer with PHP

Posted 12 November 2010 - 10:21 AM

ok I can run the server on my PC. While it's on it could access my system.. Why do I want to control my PC???

Did you read the whole entire tread? I have an app that claims to send PHP commands to a server.. If I had the right code of that server then I could control things on my PC.

This is not impossible, because the server would be on my PC. All I need is just the code to do it. But don't know where to start.

View Postcreativecoding, on 12 November 2010 - 09:18 AM, said:

PHP is server-side code. So, you cannot actually shut down your computer. There are two ways you can do this though.

1. Create a PHP emailer and then follow this tutorial: <Removed Link to Hacking Site>

2. Create a php script that outputs 1, 2, or program. 1 being shutdown, 2 being logoff, and program for starting programs. Then create a script on your computer that automatically gets the source of the web page, and then do the correct function.


Thanks for the tip

This post has been edited by macosxnerd101: 12 November 2010 - 10:23 AM

Was This Post Helpful? 0
  • +
  • -

#5 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3490
  • View blog
  • Posts: 10,058
  • Joined: 08-June 10

Re: How to control my computer with PHP

Posted 12 November 2010 - 10:23 AM

personally, Id use Java, C or C++ for that. PHP is not the best language to interact with the OS.
Was This Post Helpful? 0
  • +
  • -

#6 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6039
  • View blog
  • Posts: 23,437
  • Joined: 23-August 08

Re: How to control my computer with PHP

Posted 12 November 2010 - 10:24 AM

You can do all sort of system related tasks -- anything that can be run through the system() command -- *IF* you give the user under which the webserver is running permissions to do so. HOWEVER, that's one big-ass security hole you open up there.
Was This Post Helpful? 0
  • +
  • -

#7 youbob1212  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 16
  • View blog
  • Posts: 132
  • Joined: 31-October 10

Re: How to control my computer with PHP

Posted 12 November 2010 - 10:27 AM

Ok so this PHP Getter would send commands to a PHP server, but I have to use a different language to control my PC. Like Java...

Maybe the PHP server could active that Java Commend.. I'm just want to use this app for something...

THANKS for the Cell phone texting thing
Was This Post Helpful? 0
  • +
  • -

#8 Martyr2  Icon User is offline

  • Programming Theoretician
  • member icon

Reputation: 4319
  • View blog
  • Posts: 12,100
  • Joined: 18-April 07

Re: How to control my computer with PHP

Posted 12 November 2010 - 10:31 AM

JackOfAllTrades is right on the money here. If you ran the webserver software on your machine, gave its user account full admin permissions to your computer and then map all incoming requests through some sort of system() calls, yes you could do it. However the security on the machine would be fully compromised and I personally don't think it is worth it.

If you insist on doing this, look up the system() function, make sure you disable PHP safe_mode and then look to have incoming requests to trigger code that will call system() commands. Oh that and hope that no one finds out your server is doing this and exploits it to hell.

:)
Was This Post Helpful? 0
  • +
  • -

#9 macosxnerd101  Icon User is offline

  • Self-Trained Economist
  • member icon




Reputation: 10397
  • View blog
  • Posts: 38,468
  • Joined: 27-December 08

Re: How to control my computer with PHP

Posted 12 November 2010 - 10:35 AM

The app doesn't send PHP-specific commands to the Server- it uses the GET method to send them. Java is perfectly capable of retrieving and parsing the GET data from the server. If you don't want to use Java, perhaps a cron job is the way to go on your server (perhaps someone more experienced in web development can advise better).
Was This Post Helpful? 0
  • +
  • -

#10 youbob1212  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 16
  • View blog
  • Posts: 132
  • Joined: 31-October 10

Re: How to control my computer with PHP

Posted 12 November 2010 - 11:21 AM

cools Thanks for the information
Was This Post Helpful? 0
  • +
  • -

#11 youbob1212  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 16
  • View blog
  • Posts: 132
  • Joined: 31-October 10

Re: How to control my computer with PHP

Posted 12 November 2010 - 01:52 PM

Ok I found the a forum link that answer my one of my questions, such as, how do you shutdown your computer with your cell phone.

http://hak5.org/foru...erbird+shutdown

I have to thank you for the information posted here.

Sadly, I it's very unwise or impossible to use php for computer control.

However, I can live with this solution.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1