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

Need help badly on http.request

Started by AnDwHaT5, 09 February 2013 - 06:47 AM
AnDwHaT5 #1
Posted 09 February 2013 - 07:47 AM
Ok so i want to be able to use my console in-game and i know its possible so all day i have been trying something like
print("What do you want to do in console? : ")
term.setCursorPos( ya know next to the colon above)
http.request("theip" "&command=" ..command "")


the rest i cant think of nor can i get it to work.
the console is set up with only one input bar and here is all of the <html> code for the serch bar.
(<form action="/multicraft/index.php?r=server/log&amp;amp;id=352" method="post"> <table class="stdtable" style="width: 100%">
<tbody><tr>
<td>
<div style="display:none">
<input type="text" name="ieBugWorkaround">
</div>
<input type="text" id="command" name="command" value="" style="width: 100%">
</td>
<td>&amp;nbsp;
<input type="submit" name="yt0" value="Send" id="yt0"> </td>
</tr>
<tr>
<td colspan="2">
<div class="flash-error" id="command-error" style="display: none;"></div>
</td>
</tr>
</tbody></table>
</form>
)

more the less thats it now i simply need to make my computer input a command in it to make the console work. yes there is a loggin thing for the console if that helps
Lyqyd #2
Posted 09 February 2013 - 08:11 AM
Your signature was edited to conform with size guidelines.

You will either need to structure your URL according to whatever scheme a submitted search uses, or look into using http.post, which may well be easier.
AnDwHaT5 #3
Posted 09 February 2013 - 08:35 AM
it wont help me uhh this is so hard its like a search bar but i dont know how to select it nor how to use what i found which was




local function post(one,two)
http.post(
"http://website.extension/folder/post.php",
"one="..textutils.urlEncode(tostring(one)).."&amp;"..
"two="..textutils.urlEncode(tostring(two))
)
end
post("testing", "123")
but i dont know how to use it for such a task it just wont work