You must send an HTTP POST request to your URL. The option is to do this with file_get_contents and provide context. Creating context is easy with stream_context_create . An example is as follows:
$data = http_build_query( array( 'first' => 'your first parameter', 'second' => 'your second parameter' ) ); $headers = array('http' => array( 'method' => 'POST', 'header' => 'Content-type: application/x-www-form-urlencoded', 'content' => $data ) ); $context = stream_context_create($headers); $result = file_get_contents($url, false, $context);
This will send a POST request to $ url. $_POST['first'] and $_POST['second'] will be available in your destination URL.
If you want to republish all published variables, replace the first line as follows:
$data = http_build_query($_POST);
alexn source share