robil ktos cos z biblioteka libcurl w c++?
uzywam proste sample.cpp
Kod:
[/int main(void)
{
CURL *curl;
CURLcode res;
CURL *ch;
/* In windows, this will init the winsock stuff */
curl_global_init(CURL_GLOBAL_ALL);
/* get a curl handle */
curl = curl_easy_init();
if (curl) {
/* First set the URL that is about to receive our POST. This URL can
just as well be a https:// URL if that is what should receive the
data. */
curl_easy_setopt(curl, CURLOPT_URL, "http://formularz.fapppening.dotcom/");
/* Now specify the POST data -- */
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, "fap=123&sumbit=ok");
/* Perform the request, res will get the return code */
res = curl_easy_perform(curl);
/* Check for errors */
if (res != CURLE_OK)
fprintf(stderr, "curl_easy_perform() failed: %s\n",
curl_easy_strerror(res));
/* always cleanup */
curl_easy_cleanup(curl);
}
curl_global_cleanup();
system("pause");
return 0;
}
formularz ma pole typu text o nazwie fap i pole typu button o nazwie sumbit
normalnie da sie uzupelnic i dac sumbit, a jak odpalam program to mam 405 method not allowed.
tutaj moje pytanie, mam dostep do ftp i do tej strony z formularzem, jak zezwolic na method post?
ewentualnie czy jest tutaj ktos, kto umialby przerobic skrypt php tak zebym mogl uzywac metody get i wtedy uzywac direct link w stylu:
http://mojademona.sexy/skrypt.php?fap=123&sumbit=1
tak zeby po wejsciu w ten adres (w curlu) wypelniony byl formularz 123 i klikniety OK?
Zakładki