Jump to content

send POST to external site without forms


EchoFool

Recommended Posts

Hey,

 

I want to know if theres a way to send links to an external site in the form of a POST without the user doing it from a form. A file host gave me their info for their API link checker and say:

 

Feel free to use the link checking API that we uses. Simply POST to *url removed* and use the following name/value pairs: id$x=$downloadid

 

Does any one understand what they are telling me to do .. im thinking CURL ? But i don't know where to start here =/

Hmm okay thats confusing i have alot of questions:

 

<?php
$URL="www.mysite.com/test.php";
$ch = curl_init();   
curl_setopt($ch, CURLOPT_URL,"https://$URL"); 
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "Data1=blah&Data2=blah");curl_exec ($ch);    
curl_close ($ch);
?>

 

If i use CURL where do i get the return values =/ And if it returns a number of different values how do i know how to grab them :S This just seems to be doing an "include" rather than a way to return the values that im checking ?

Well i put this:

 

<?php
ForEach ($arr2 AS $Value){
$arr3 = str_split($var, 30); //cut off the url so it only has the ID in array[1]
$ch = curl_init();   
curl_setopt($ch, CURLOPT_URL,"removed from post"); 
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "id$x=".$arr3[1]."");
curl_exec ($ch);
curl_close ($ch);


Echo $Value.'<br>';
$var2 = $var2+ 1;
}
?>

 

Now the company told me this:

The script will return name, site, size and status. Status is 0 for OK, 2 for expired and 3 for temporarily unavailable.

 

But currently how do i get the return values from the above =/ because at the moment i don't have the returned values for me to use in my script ?

I equally have no idea the info i was given by them said :

 

Feel free to use the link checking API that we uses. Simply POST to *url removed* and use the following name/value pairs: id$x=$downloadid

 

I am merely guessing the POST name is id$x and thus $x is not a variable but just a string =/ Currently i just get a return value of 1 , don't know if thats my issue or at their end so im awaiting a reply from them on more info that can aide in this problem.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.