im bizzare и я новичок в stackoverflow, у меня есть некоторые проблемы, и это:
я посылаю какую-то страницу прямо на страницу, и страница отвечает на мой запрос правильно, но я, когда пытаюсь отправить данные поста, используя cURLпо php, страница нигде не реагирует:
<form action="http://remotehost.com/index.aspx" method="post"> -> its work correctly and the index.php show me what i want but when :
<form action ="http://localhost/fetch_data.php" mthod="post"> ->
fetch_data.php:
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<?php
print_r($_POST);
$remotehost_cgi = 'http://remotehost.com/index.aspx';
$ret = post_data($_POST, $remotehost_cgi);
echo $ret;
?>
<?php
function post_data($datatopost,$urltopost){
$crl = curl_init ($urltopost);
curl_setopt ($crl, CURLOPT_POST, true);
curl_setopt ($crl, CURLOPT_POSTFIELDS, $datatopost);
curl_setopt ($crl, CURLOPT_RETURNTRANSFER, true);
$returndata = curl_exec ($crl);
return $returndata;
}
?>