Gå til innhold

Curl - Hva er galt?


Anbefalte innlegg

Skrevet (endret)

Hei!

 

Jeg har følgende kode:

 

<?php
function call($fra, $til) {

//cookie file path
$cookie = "/execscriptdir/php.cgi/cookie/cookie.txt";
$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "http://www.**********/call.php");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$frontpage = curl_exec($ch);

curl_setopt($ch, CURLOPT_URL, "http://www.**********/call.php");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
$post .= "bnr=".$fra;
$post .= "fnr=".$til;
$memberpage = curl_exec($ch);
curl_exec($ch);

curl_close ($ch);
return $status;
}

echo call("004799999999", "004799999999");

?>

 

Noen som ser hva som er feil? Scriptet (http://www.**********/call.php) mottar ikke data.

 

Takker for all hjelp ;)

Endret av Quattro7
Videoannonse
Annonse
Skrevet

CURLOPT_POSTFIELDS The full data to post in a HTTP "POST" operation. To post a file, prepend a filename with @.

 

curl_setopt($ch, CURLOPT_POSTFIELDS, $post);

Skrevet (endret)

function call($fra, $til) {

//cookie file path
$cookie = "/execscriptdir/php.cgi/cookie/cookie.txt";
$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "xx");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$frontpage = curl_exec($ch);

curl_setopt($ch, CURLOPT_URL, "xx");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
$post = '';
$post .= "anrphonenr=".$fra;
$post .= "bnrphonenr=".$til;
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
$memberpage = curl_exec($ch);
curl_exec($ch);

echo $memberpage;

curl_close ($ch);
return $status;
}

echo call("004799999999", "004799999999");

 

Scriptet mottar fortsatt ikke data.

Kan forresten scriptet forbedres?

Endret av Quattro7

Opprett en konto eller logg inn for å kommentere

Du må være et medlem for å kunne skrive en kommentar

Opprett konto

Det er enkelt å melde seg inn for å starte en ny konto!

Start en konto

Logg inn

Har du allerede en konto? Logg inn her.

Logg inn nå
  • Hvem er aktive   0 medlemmer

    • Ingen innloggede medlemmer aktive
×
×
  • Opprett ny...