Pick up internal site form content (POST)

0

Hello. I would be grateful if anyone could give me a hand, a way to solve this problem.

Programming language: PHP.

Problem: I want to work with information from a website. This information is in the HTML of the site page which I will consult every day to treat this html, via php, and save the information I want in the application database that I am creating.

The problem is to pass to the site the parameter I want it to load the information I want. What I do not know is how to pass a parameter via POST.

The site is the link . I need to pass the World and save the entire html page in a variable. The fact of saving the html page and treating it, I already know.

The problem is how to pass the world parameter to the link and it loads as if I had chosen the World on the page and clicked the Submit button?

    
asked by anonymous 01.03.2018 / 18:53

1 answer

0

If you create a index.php file and paste it inside and run, the tibia page will appear. Until then, okay? but if you enter the google chrome inspector and go into the console a message will appear ...

Copy the code, run and see on your console

<?php
ini_set("display_errors", true);


$init = curl_init();

curl_setopt_array($init, [
  CURLOPT_URL => "https://secure.tibia.com/community/?subtopic=killstatistics",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_POSTFIELDS => http_build_query(["world"=>"antica"]),
  CURLOPT_SSL_VERIFYHOST => false,
  CURLOPT_SSL_VERIFYPEER => false
]);
$r     = curl_exec($init);
$close = curl_close($init);

echo $r;

This is the message, note the blank message.

ForthoseofyouwhohaveusedtheGoogleDeveloperConsolealreadyknowthatwhenyouaregoingtouseaGoogleapplication,whichinmycaseIusedOAuthToken,theyaskyoutoputaredirectthataftertheuserlogsinwithyourgoogleaccountandauthenticate,Googlewillredirecttoyourinternetpageandpassthetokenvia?token=blablaqueryget.Ithinkfacebookishappeningthesamething,neverusedit,butthat'sprobablyit.

SummarizingYouwouldhavetohaveaccesstotheAPIthattheownercreatedthereonfacebook.

Incasefacebookwillonlyacceptrequestscomingfrom link but we are using link , understand?

    
01.03.2018 / 19:14