How to post data to another website using script?

Hi,

I want to form post some data to another website using a script. How can i do that ?

For eg.

fullname=some name
city=coolcity
postcode=123456

I want to send the following data to http://www.test.com/test.php using form’s post method u know

<form method="post" action="http://www.test.com/test.php">
<input type="hidden" name="fullname" value="some name">
<input type="hidden" name="city" value="coolcity">
<input type="hidden" name="postcode" value="123456">
<input type="submit" value="Submit" />
</form>

Hope i have explained clearly. Please help.

Thanks.

You can use cURL to for this, [URL=“http://www.askapache.com/htaccess/sending-post-form-data-with-php-curl.html”]here’s a little tutorial.

This is really easy to do using Zend Framework.

$client = new Zend_Http_Client('http://www.test.com/test.php');
$client->setParameterPost(array(
    'fullname' => 'some name',
    'city'     => 'coolcity',
    'postcode' => '123456',
));
$response = $client->request(Zend_Http_Client::POST)

file_get_contents(), or fopen() and friends can also be used if supplied with a context from stream_context_create()

Hi,

Did this ever work for you?

I’m trying to do a similar thing and I would like some pointers to start this please:

Hi,

I am looking after the website of our local soccer club and I need some help.

The following website is the site of our league and I would like to create a link to this website in our club’s website.

.wdsl.league.ie/results.php

What I would like to do is open the site with the correct information. If you have a look at the site you can see you have to select 2 criteria: 1) Competition 2) Division

I would like to create a link that opens directly with the page for:

Competition = u10 League
Division = u10 Division 1

I suppose this is done by post data but I have no experience in this and all the examples I have found so far only give me the script but not how to integrate it into a useable link

Thanking you in advance