cesarcesar
Programmer
- Mar 5, 2003
- 30
Hello all,
How to get the $response var to return with a value in it.
____________________________________
www.site1.com/test1.php
____________________________________
www.site2.com/test2.php -
How to get the $response var to return with a value in it.
____________________________________
www.site1.com/test1.php
Code:
$post_array = array(
"test1" => "a"
,"test2" => "b"
,"test3" => "c"
);
// Convert Array to POST string (key_1=val_1&key_2=val_2...)
reset($post_array);
while (list ($key, $val) = each($post_array)) {
$data .= $key . "=" . urlencode($val) . "&";
}
exec("/usr/bin/curl -m 120 -d \"$data\" [URL unfurl="true"]http://www.site2.com/test2.php[/URL] -L", $response);
// $response returns empty. i need this to have the new $_POST vars in it
print_r($response);
www.site2.com/test2.php -
Code:
// my own function. working fine.
custom_insert('test_db');
// set new $_POST vars.
$_POST['x'] = "x";
$_POST['y'] = "y";
$_POST['z'] = "z";
// this is not returning properly.
Return $_POST;