Get data by sending input to other website using simple dom parser

39 views Asked by At

How can I get response data by sending input value to some website through POST method by using Simple Dom Parser? For eg, below is the URL and I want to post one data to this URL and I want response data as a output in my file.

$html_base = file_get_html('https://someurl.com/');
1

There are 1 answers

0
nerd100 On

Hi i think you looking for ajax. You can send Data to an URL and if your request succeed then you get your data

$.ajax({
  method: "POST",
  url: "some url",
  data: { name: "John", location: "Boston" }
})
  .done(function( msg ) {
    alert( "Data Saved: " + msg );
  });