Confidence Posted June 15, 2010 Share Posted June 15, 2010 if($GLOBALS["HTTP_RAW_POST_DATA"]){ $vars = explode(';',$GLOBALS["HTTP_RAW_POST_DATA"]); $permalink = $vars[1]; $action = $vars[0]; if(strlen($permalink) <= 0){ echo "no permalink sent"; return false; } if(strlen($action) <= 0){ echo "No transaction-ID sent"; return false; } echo 'provider-1'; }else{ echo "No Data sent."; return false; } can someone tell me, how do i test the different cases of this code? i tried something like function post_data($url, $data) { $params = array('http'=>array('method'=>'POST', 'content'=>$data)); $ctx = stream_context_create($params); $fp = @fopen($url, 'rb', false, $ctx); $response = @stream_get_contents($fp); //echo $response; return $response; } echo post_data('http://localhost/mfe/ocr/index.php','4345;naswa'); but i get all the time: No Data sent. Quote Link to comment https://forums.phpfreaks.com/topic/204829-how-to-test-thispost-data/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.