Jump to content

How to test this?POST Data


Confidence

Recommended Posts

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.

Link to comment
https://forums.phpfreaks.com/topic/204829-how-to-test-thispost-data/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.