I used the following code to post the values from one page to another page but don't know why for some reason the values are not posted. Can anyone help me correcting the below code, thanks.
<?php $postdata = http_build_query( array( 'destinationId' => 'E5322331-EB43-4C45-B5B1-00E455401676', 'keywords' => 'Rambouillet, France' ) ); $opts = array('http' => array( 'method' => 'POST', 'header' => 'Content-type: application/x-www-form-urlencoded', 'content' => $postdata ) ); $context = stream_context_create($opts); $result = file_get_contents('https://dev.ther8server.com/hotel-search/go/rambouillet-france', false, $context); header('Location:https://dev.ther8server.com/hotel-search/go/rambouillet-france'); ?>
stream_context_createis more like a curl call. If you are trying to make persistent data between pages, try using session variables instead.header Locationfor redirection purpose.