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

Status
Not open for further replies.

mysystem

New Member
Messages
5
Reaction score
0
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.
 

bugfinder

Retired
Messages
2,260
Reaction score
0
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.
 

mysystem

New Member
Messages
5
Reaction score
0
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
 

mysystem

New Member
Messages
5
Reaction score
0
Points
0
Then please enable them or tell me other way to perform this action.
 

mysystem

New Member
Messages
5
Reaction score
0
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.
 
Status
Not open for further replies.
Top