Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8981805
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T20:25:36+00:00 2026-06-15T20:25:36+00:00

Hi i have a domain i’d like to parse with cUrl and here is

  • 0

Hi i have a domain i’d like to parse with cUrl and here is the case:

When i go on domain http://register.metsad.ee/avalik/info_teatis.php?too_id=2942704201

it redirects me to [ register.metsad.ee/avalik/info_teatis.php?too_id=2942704201 ]

its the same thing without http:// www.
code i use to parse is:

function get_data($url) {
        $ch = curl_init();
        $timeout = 5;
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
        curl_setopt($ch, CURLOPT_MAXREDIRS, 10);
        curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
        $data = curl_exec($ch);
        curl_close($ch);
        return $data;
    }
$src = 'http://register.metsad.ee/avalik/info_teatis.php?too_id=2942704201';

And then $c = get_data($src);
echo $c;

For resoult i get a blank white page. I also tried with Simple_Html_Dom parser like this:

echo file_get_html($src)->plaintext;

But still i get a blank white page. When i trie to parse without http:// then there is an error that

Warning: file_get_contents(register.metsad.ee/avalik/info_teatis.php?too_id=2942704201) [function.file-get-contents]: failed to open stream: Result too large in C:\xampp\htdocs\Trash\metsakontroll\system\c_simple_html_dom.php on line 70

cUrl gives still white screen, no effect. When i tried to parse it like a folder like this:

http://www.metsad.ee/register/avalik/info_teatis.php?too_id=2942704201 then server says Not Found

i searched the whole internet =/ any ideas how to read that page via cUrl or Simple_html_dom ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T20:25:37+00:00Added an answer on June 15, 2026 at 8:25 pm

    There is some kind of protection on register.metsad.ee side. Thay return empty response until User-Agent header is set.

    Failed call (empty response):

    feedbee@server:~$ telnet register.metsad.ee 80
    Trying 213.184.43.115...
    Connected to register.metsad.ee.
    Escape character is '^]'.
    GET /avalik/info_teatis.php?too_id=2942704201 HTTP/1.1
    Host: register.metsad.ee
    
    HTTP/1.1 200 OK
    Date: Thu, 13 Dec 2012 20:07:11 GMT
    Server: Apache
    Content-Length: 0
    Content-Type: text/html; charset=UTF-8
    

    Successfull call (HTML page returned):

    feedbee@server:~$ telnet register.metsad.ee 80
    GET http://register.metsad.ee/avalik/info_teatis.php?too_id=2942704201 HTTP/1.1
    Host: register.metsad.ee
    User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20100101 Firefox/12.0
    
    HTTP/1.1 200 OK
    Date: Thu, 13 Dec 2012 20:13:07 GMT
    Server: Apache
    Expires: Thu, 19 Nov 1981 08:52:00 GMT
    Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
    Pragma: no-cache
    Set-Cookie: SNS=a0e425c2aec17c38be3716b366f75749; path=/
    Transfer-Encoding: chunked
    Content-Type: text/html; charset=UTF-8
    
    762
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    ...
    

    So you need to add the next line to:

    curl_setopt($ch, So you need to add CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20100101 Firefox/12.0"); for example (or any other user agent string).
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have a domain class like package trip.side import java.text.SimpleDateFormat class HotelStay { String
I would like to have domain.com using asp.net mvc2 technology and domain.com/blog would use
If I have domain classes like: class A { short aCode //... static hasMany
I have domain name for eq. 1) http://www.abc.com/search 2) http://go.abc.com/work I get only domain
I have field int displayOrder = 1 in Grails domain object and would like
For example, let's say I have domain.com. Can I configure http://subdomain1.domain.com to be hosted
I have domain like this: class Team { hasOne [leader: Person] hasMany [member: Person]
I have two domain objects like below User.java Public class User{ private int userId;
I have domain that has more than one unique fields like the following class
can I have domain.com/action/id as well as domain.com/controller/action? how would I register these in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.