Http post problem

I’m trying to use script to send a http post to a remote server, however, the form can get the data but will not send the post.

$form_data = array();
//Adding data to $form_data here:

$post_data = http_build_query($form_data);
$opts = array("http"=>
                              array("method"=>"POST",
                                      "header"=>"Content-type: application/x-www-form-urlencoded\\r\
",
                                      "user_agent"=>$_SERVER['HTTP_USER_AGENT'],
                                      "time_out"=>30,
                                      "content"=>$post_data
                             )
                    );
$context = stream_context_create($opts);

$page_content = file_get_contents("http://www.directorybin.com/submit.php", false, $context);

if($page_content) echo $page_content;
else echo "FAILED TO SEND THE POST";

You can view the result of the script here: http://www.cheapsubmit.net/dir_sub.php, obviously, the script didn’t send the post, since except smarty errors, we didn’t get response from the directory.

What’s wrong with the above script? And also how to solve the smarty errors?

I would go for curl if it is allowed in the server.
http://www.php.net/manual/en/function.curl-setopt.php

I tried with curl, still no success.

Can any experts help?

Can anybody help?