crypt
Here is one thing I haven't been able to figure out. Luckily every time I've run into it, I've found a workaround. However, I have not been able to figure out how to use curl to make a multipart post. I have found a link on the curl homepage that explains how to upload a file with a multipart form (which is actually the purpose of the multipart form). That method requires you to have a file, and well I don't intend to upload a file. All I am trying to do is post comment spam on a few blogs. Sorry, don't have any links handy, because I haven't run into it for a while... Any ideas?
Here is the article on how to upload a file: http://curl .netmirror.org/libcurl/php/examples/multipartpost.htmlThanks PS: I moved this to the correct forum cdc
It's actually pretty simple. Instead of passing a string like this as your parameter:
"variable1=value1&variable2=value2" You just put them in an associative array: $parameters = array("variable1" => "value1", "variable2" => "value2"); Nothing else changes. Bompa
quote author=crypt link=topic=217.msg1319#msg1319 date=1179114572 Here is one thing I haven't been able to figure out. Luckily every time I've run into it, I've found a workaround. However, I have not been able to figure out how to use curl to make a multipart post. I've seen this same question somewhere a few months ago. Was that you crypt? Anyways, unless I am completely misunderstanding you, you want to post some info like username, then you have to click Continue, and then you get another page with another form that asks for more info, right? Post the info for the first page. The server you are posting to then sends back the next page and your code should parse it for the variable that it wants, (while testing i have the returned-page printed to my console and printed to a file so I can look it over). So, you script, still running, not stopping, parses the second page for variables and posts them to the correct URL. The same process could go on and on, it's still the same logic in the code. The thing is, when finished and working, your script can not stop in between the form pages unless it were to save previous variables to disk then read them in when it starts up again, which is nuts. Bompa crypt
Actually cdc mentioned my work around, I guess that's just the proper way to do it. Didn't think it would work all the time.
thanks crypt
I see what you're saying now Bompa.. Nope, not the same thing I'm dealing with.. That's the oldskool way to pass variables using hidden inputs. I've run into this one recently too, but it was easy enough to figure out.
Bompa
I guess I don't know what ppl mean when they say "multipart" form.
oh well. nutballs
the short version is multipart form encoding is used when you are using forms to upload non-text (files) through a webpage.
so like the image uploader on imageshack.us is a multipart form. Bompa
quote author=nutballs link=topic=217.msg1504#msg1504 date=1179417496 the short version is multipart form encoding is used when you are using forms to upload non-text (files) through a webpage. so like the image uploader on imageshack.us is a multipart form. Ohhhhh. I have not yet had the need to upload non-text files. I thought they meant multi-page forms, duh. nutballs
yea, its actually surprising how, Un-straightforward it is to do as well.
|
Thread Categories
Best of The Cache Home | ||
Search The Cache |
- Ajax
- Apache & mod_rewrite
- BlackHat SEO & Web Stuff
- C/++/#, Pascal etc.
- Database Stuff
- General & Non-Technical Discussion
- General programming, learning to code
- Javascript Discussions & Code
- Linux Related
- Mac, iPhone & OS-X Stuff
- Miscellaneous
- MS Windows Related
- PERL & Python Related
- PHP: Questions & Discussion
- PHP: Techniques, Classes & Examples
- Regular Expressions
- Uncategorized Threads