how to complete a submit-form with checkbox as a required thing (no, it's not the i'm human xD) from a page, using http_* functions?

rytan451

Member
If you're sending form data (like described in this page), then you should be able to construct a body string/buffer that would indicate the checkbox is ticked. Then, you can put the body string/buffer into the fourth parameter of http_request, as per the manual.
 

Edgamer63

Member
Show your existing code and the exact parameters that the server expects.
Ok, i got the page in html format, and it have a lot of things. But, i can see that there are important id's of the POST method in form, like: fullname, username etc. Attached file (html of the php file): http://www.mediafire.com/file/ywtw26w2yjbolww/page.html/file .

Also my code is just like this:
GML:
s=http_get("my_page.php?fullname=Some%20Person&username=&email=email%40gmail.com&password=pass123&password_confirm=pass123")
I'm just trying to do it as the browser does... is that so hard? D:

If you're sending form data (like described in this page), then you should be able to construct a body string/buffer that would indicate the checkbox is ticked. Then, you can put the body string/buffer into the fourth parameter of http_request, as per the manual.
kinda tryin' to do it, but with the specified info that appears in that html representation of the page.
 
Last edited:

TsukaYuriko

☄️
Forum Staff
Moderator
What exactly is the specification of the .phpfullname file format? ;)

You might want to put a question mark in the middle there...
 

FrostyCat

Redemption Seeker
Your form clearly says POST in its method, use http_post_string() instead of http_get(). And you should NOT expect the actual response in s like that, the Manual clearly tells you the response comes in an Async - HTTP event.

Sending the request:
GML:
xhr_form = http_post_string("https://mysite.com/register_action.php", "fullname=Some%20Person&username=&email=email%40gmail.com&password=pass123&password_confirm=pass123&answer=23&firstRandomNumber=7&secondRandomNumber=16&referer=&referral=a_referal&custom-switch-input=1");
Async - HTTP:
GML:
if (async_load[? "id"] == xhr_form) {
    switch (async_load[? "status"]) {
        case 1: break;
        case 0:
            /* Handle response in async_load[? "result"] here */
        break;
        default:
            /* Handle request failure here */
    }
}
 
Top