Jump to content




Http


  • This topic is locked This topic is locked
4 replies to this topic

#1 svdragster

  • Members
  • 222 posts
  • LocationGermany

Posted 30 March 2013 - 12:03 AM

Hey,

I already looked for some tutorials and the wiki, but couldn't find any.

How can I use the http.post API with PHP (I'm currently learning php so I won't know everything)?
I want to upload data from a computer.


#2 Mads

  • Members
  • 604 posts
  • LocationCopenhagen, Denmark

Posted 30 March 2013 - 12:13 AM

http://computercraft.../wiki/HTTP_(API)

#3 svdragster

  • Members
  • 222 posts
  • LocationGermany

Posted 30 March 2013 - 12:15 AM

Doesn't help me in any way. :(

#4 LBPHacker

  • Members
  • 766 posts
  • LocationBudapest, Hungary

Posted 30 March 2013 - 02:07 AM

http.post("http://yourpage.com", "var1=cat&var2=bench")

In PHP, you can get var1 and var2 (in _POST array) like this:
echo $_POST["var1"];
echo $_POST["var2"];


If you want to put the variables into $_GET, use http like this:
http.get("http://yourpage.com?var1=cat&var2=bench")


#5 Cranium

    Ninja Scripter

  • Moderators
  • 4,031 posts
  • LocationLincoln, Nebraska

Posted 30 March 2013 - 02:12 AM

Locked upon request.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users