Sending POST data without Submit button or javascript.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Sugapablo

    #1

    Sending POST data without Submit button or javascript.

    Ok, say I have some data:

    $name = "Some Name"
    $email = "some@email.com "
    etc.

    I'd like to send these to a page as POST data, as if they were coming
    from a web form, but without having either a "submit" button or using
    Javascript's submit() function.

    Is there a way to do this?

    --
    Sugapablo - russpghREMOVE@s targate.net
    http://www.sugapablo.com | ICQ: 902845

  • Jochen Buennagel

    #2
    Re: Sending POST data without Submit button or javascript.

    Sugapablo wrote:
    [color=blue]
    > I'd like to send these to a page as POST data, as if they were coming
    > from a web form, but without having either a "submit" button or using
    > Javascript's submit() function.
    >
    > Is there a way to do this?[/color]

    Yes. The easiest is to use a library or class that someone else wrote
    for the purpose. Check this search and see if there is anything you can
    use:
    http://www.phpclasses.org/search.htm...and&sort=score

    Jochen

    --
    /**
    * @author Jochen Buennagel <zang at buennagel dot com>
    * @see http://www.sourceforge.net/projects/zang
    */

    Comment

    • Sugapablo

      #3
      Re: Sending POST data without Submit button or javascript.

      Jochen Buennagel wrote:
      [color=blue]
      > Yes. The easiest is to use a library or class that someone else wrote
      > for the purpose. Check this search and see if there is anything you can
      > use:
      > http://www.phpclasses.org/search.htm...and&sort=score[/color]

      The cHTTP class worked wonderfully.

      Thanks.

      --
      Sugapablo - russpghREMOVE@s targate.net
      http://www.sugapablo.com | ICQ: 902845

      Comment

      • nikonetwork
        New Member
        • Apr 2006
        • 1

        #4
        Tryed the same: didn't work

        Originally posted by Sugapablo
        Jochen Buennagel wrote:
        [color=blue]
        > Yes. The easiest is to use a library or class that someone else wrote
        > for the purpose. Check this search and see if there is anything you can
        > use:
        > http://www.phpclasses.org/search.htm...and&sort=score[/color]

        The cHTTP class worked wonderfully.

        Thanks.

        --
        Sugapablo - russpghREMOVE@s targate.net
        http://www.sugapablo.com | ICQ: 902845
        Hi, I just tryed also the cHTTP class, but didn't worked as expected for me:
        When I execute my code, nothing happens. I was expecting to be redirected to the URL where I want to send data in POST.
        here is my code:
        <?
        include("cHTTP. php");
        //create instance of the class
        $http = new cHTTP();
        // to make posts
        // clear all fields
        $http->clearFields( );

        $http->addField ( 'email' , 'post1' );
        $http->addField ( 'password' , 'post2' );

        $http->postPage("http ://www.sxmone.com/aroundme/testReader.php" );
        ?>

        Did you do it different? How can I be redirected to "testReader.php " with my info posted?

        Comment

        Working...