Log in to your ASP site before using PHP Simple HTML DOM Parser

I use "PHP Simple HTML DOM Parser" to parse data from an ASP gaming website. The data that I need to capture is visible only to registered users, so I need something to enter the site before I start using it. Can someone suggest me a script or something that he can do? Thank you very much in advance!

+3
source share
1 answer

First, you must send a message using

<?php
function do_post_request($url, $data, $optional_headers = null)
{
  $params = array('http' => array(
              'method' => 'POST',
              'content' => $data
            ));
  if ($optional_headers !== null) {
    $params['http']['header'] = $optional_headers;
  }
  $ctx = stream_context_create($params);
  $fp = @fopen($url, 'rb', false, $ctx);
  if (!$fp) {
    throw new Exception("Problem with $url, $php_errormsg");
  }
  $response = @stream_get_contents($fp);
  if ($response === false) {
    throw new Exception("Problem reading data from $url, $php_errormsg");
  }
  return $response;
}

It should be able to send a mail request. After that, you can get what you need.

0
source

All Articles