Помогите разобраться со скриптом, скрипт писал я, не могу понять почему не работает! Значит пишу вот такой вот скриптик, где ошибки подскажите? Code: <? function post_content ($url,$postdata) { $uagent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)"; $ch = curl_init( $url ); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_ENCODING, ""); curl_setopt($ch, CURLOPT_USERAGENT, $uagent); curl_setopt($ch, CURLOPT_TIMEOUT, 120); curl_setopt($ch, CURLOPT_FAILONERROR, 1); curl_setopt($ch, CURLOPT_AUTOREFERER, 1); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata); $content = curl_exec( $ch ); $err = curl_errno( $ch ); $errmsg =curl_error( $ch ); $header = curl_getinfo( $ch ); curl_close( $ch ); $header['errno'] = $err; $header['errmsg'] = $errmsg; $header['content'] = $content; return $content; } $url='http://sendsms.owap.biz/'; $postdata="tel=7**********&pass=******';"; $html=post_content ($url,$postdata); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "http://sendsms.owap.biz/send.php?tel=**********&pass=******&phone=9281896078&from=qChat&text=Test"); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30); curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)'); $data = curl_exec($ch); curl_close($ch); ?>
PHP: <?php function post_content($url,$postdata) { $uagent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)"; $ch = curl_init( $url ); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_ENCODING, ""); curl_setopt($ch, CURLOPT_USERAGENT, $uagent); curl_setopt($ch, CURLOPT_TIMEOUT, 120); curl_setopt($ch, CURLOPT_FAILONERROR, 1); curl_setopt($ch, CURLOPT_AUTOREFERER, 1); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata); $content = curl_exec( $ch ); $err = curl_errno( $ch ); $errmsg =curl_error( $ch ); $header = curl_getinfo( $ch ); curl_close( $ch ); $header['errno'] = $err; $header['errmsg'] = $errmsg; $header['content'] = $content; return $content; } $url='http://sendsms.owap.biz/'; $postdata="tel=7**********&pass=******';"; $html=post_content($url,$postdata); $ch = curl_init(); curl_setopt($ch,CURLOPT_URL,"http://sendsms.owap.biz/send.php?tel=**********&pass=******&phone=9281896078&from=qChat&text=Test"); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30); curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)'); $data = curl_exec($ch); curl_close($ch); ?> Что в ошибках пишет? З.Ы. pass=******';"; - там апостроф и ' не лишние? З.Ы.Ы. все-таки скрипт скопипастил)) http://parsing-and-i.blogspot.com/2009/10/curl-post.html
Как ни странно в ошибки ни чего не выдает! Просто тупо пустая страница! '; действительно было лишние убрал