This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
elfin8er's profile picture

PHP Code With Computercraft?

Started by elfin8er, 08 December 2012 - 08:11 AM
elfin8er #1
Posted 08 December 2012 - 09:11 AM
I was just wondering if it's possible to run php code via computercraft, either directly in CC, or a php script that I have on my web server.
Lyqyd #2
Posted 08 December 2012 - 09:14 AM
You could write a PHP interpreter in lua (or find one and adapt it), or serve the page and interpret the results using lua.
zekesonxx #3
Posted 09 December 2012 - 07:04 AM
Why would you want to? It seems a lot to adapt a advanced language so that you can program a couple CC scripts in a familiar language.
snoble2022 #4
Posted 09 December 2012 - 08:52 PM
I agree with him. If this is what you want to do then don't. Its pointless. However, if you're doing this for a pastebin, github, or dropbox host, just using regular lua code works. Php is a complicated language compared to lua anyways. Hope this helps
1lann #5
Posted 09 December 2012 - 09:58 PM
@The 2 people above

You know, using PHP on a webserver can do ALOT more than lua in CC.

@The op

CC allows you to use the http get and post protocols. Which means you can use cc to send requests to a php script on a webserver and for the webserver to respond back.
snoble2022 #6
Posted 10 December 2012 - 08:40 AM
I meant if you're using a service like github. You can just post the lua language instead of php in the file.