开发者

Send textfield contents from iPhone app to webserver (save as .php)

I'm attempting to write an app that allows users to test PHP code within their iPhone. It will take the contents of a UITextField (the content will start with ) and send t开发者_如何转开发o a webserver. I need to save the contents as .php and run the code, then echo the output back to the iPhone app. Would anyone have any advice on how to do this?


As I've said elsewhere, this is a massive security risk as if you're allowing people to enter their own PHP code and execute it on your server, then it could obviously do anything that a native script could.

OK, here'a are a few examples of why this is a very bad idea.

  1. Script that uses proc_open with a for loop to open 'n' hundred processes on your server. Your server grinds to a halt.

  2. Script that grabs a high level directory and attempts to recursively delete everything it can find. (Unlikely to cause too much harm if you don't have any odd directory rights and PHP is running as nobody/nobody or similar.)

  3. Script that does a DROP DATABASE on all databases it has access to. (If you have any defines, database access objects or global variables with DB information in, this is fair game.)

    ...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜