Let’s say I have a form from a remote area http://example.com/form.php which contains:
<form action="" method="post" enctype="multipart/form-data">
<label for="file">Filename:</label>
<input type="file" name="file" id="file" />
<input type="text" name="name">
<input type="text" name="age">
<input type="text" name="sex">
<br />
<input type="submit" name="submit" value="Submit" />
</form>
How do I send data to that form, submit it and fetch whatever the result of the form submission is? I found a function in the php site but I don’t know how to use it or if it’s the right one to use.
http://www.php.net/manual/en/function.stream-context-create.php#90411
You want to POST to that form programmatically? You can do this easily with cURL.