http_post_data(), http_put_data(), http_post_fields() - Functions are not working

Discussion in 'Free Hosting' started by mysystem, Jul 2, 2008.

Thread Status:
Not open for further replies.
  1. mysystem

    mysystem New Member

    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    0
    http_post_data(), http_put_data(), http_post_fields() - Functions are not working
    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    1.php
    -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    <html>
    <head>
    <title>
    Test
    </title>
    </head>
    <body>
    <?php
    $to=$_POST['to'];
    $from=$_POST['from'];
    $sub=$_POST['sub'];
    $msg=$_POST['msg'];
    $msg="From: $msg";
    mail($to,$sub,$msg,$from);
    ?>
    </body>
    </html>
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    2.php
    -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    <html>
    <head>
    <title>
    Test
    </title>
    </head>
    <body>
    <?php
    $info = array(
    'to' => 'my@my.com',
    'from' => 'we@my.com',
    'sub' => 'Test',
    'msg' => 'Testing!'
    );
    $none=array();

    http_post_fields("1.php", $info, $none);
    echo "DONE!";
    ?>
    </body>
    </html>
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    I wrote these two files but 2.php is saying Call to undefined fuctions. I also tried these - http_post_data(), http_put_data(), http_post_fields() - These
    functions are also not working. Please help me. I want that people open 2.php and the php post those data to 1.php. Please help me.
     
  2. bugfinder

    bugfinder Retired

    Messages:
    2,260
    Likes Received:
    0
    Trophy Points:
    0
    There isnt much error checking in your code however:

    Try changing the line to

    Code:
    http_post_fields("http://yourdomain.com/dir/1.php",$info);
    as "1.php" has no URL its just a filename.
     
  3. mysystem

    mysystem New Member

    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    0
    I did what you said. But same error : Call to undefined function though its a library function. Please fix this problem or tell me other way to perform this type of action
     
  4. bugfinder

    bugfinder Retired

    Messages:
    2,260
    Likes Received:
    0
    Trophy Points:
    0
    Its currently disabled on our servers, Ive just checked.
     
  5. mysystem

    mysystem New Member

    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    0
    Then please enable them or tell me other way to perform this action.
     
  6. bugfinder

    bugfinder Retired

    Messages:
    2,260
    Likes Received:
    0
    Trophy Points:
    0
  7. mysystem

    mysystem New Member

    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    0
    Thanks. But I want to post data to 1.php but don't want to see the result of 1.php. How can it be possible? Please help me.
     
Thread Status:
Not open for further replies.

Share This Page