Try with:
curl_setopt($ch, CURLOPT_URL,"http://127.0.0.1/script.php");
and CURLOPT_POSTFIELDS sould be an array:
$data = array('postdata' => 'postdata', 'postdata1' => 'postdata1');curl_setopt($ch, CURLOPT_POSTFIELDS, $data);