SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Evangelist Tapan's Avatar
    Join Date
    May 2005
    Location
    India
    Posts
    556
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    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

    Code:
    <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.

  2. #2
    Twitter: @AnthonySterling silver trophy AnthonySterling's Avatar
    Join Date
    Apr 2008
    Location
    North-East, UK.
    Posts
    6,111
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    You can use cURL to for this, here's a little tutorial.
    @AnthonySterling: I'm a PHP developer, a consultant for oopnorth.com and the organiser of @phpne, a PHP User Group covering the North-East of England.

  3. #3
    Use The Cloud
    Join Date
    Jan 2006
    Location
    Boise, ID
    Posts
    556
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Tapan View Post
    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

    Code:
    <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.

    This is really easy to do using Zend Framework.

    Code:
    $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)

  4. #4
    SitePoint Wizard bronze trophy
    Join Date
    Jul 2008
    Posts
    5,757
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    file_get_contents(), or fopen() and friends can also be used if supplied with a context from stream_context_create()

  5. #5
    SitePoint Member
    Join Date
    Feb 2010
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •