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 6040311
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T06:29:45+00:00 2026-05-23T06:29:45+00:00

I need some help with setting up a cURL request to a page. In

  • 0

I need some help with setting up a cURL request to a page. In the netherlands we have this site ‘RDW.NL’ which gives you the opportunity to check up a vehicle’s details by entering the licence plate number.

For businesses, there is a paid alternative to request large amounts of data, but the costs are too high (€1050 + €0,50 per request) to pay this since it’s just for personal use and for testing purposes only.

Recently they changed their website and the old scripts stopped working, so I decided to give it a try myself but I’m kind of stuck.

Here’s what I have so far:

<?php

    $ckfile = "/tmp/rdwcookie.txt";

    # Setup first URL
    $ch = curl_init("https://ovi.rdw.nl/Default.aspx");
    curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13');
    curl_setopt($ch, CURLOPT_HEADER, false);
    curl_setopt($ch, CURLOPT_FRESH_CONNECT, true);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_COOKIESESSION, true);
    curl_setopt($ch, CURLOPT_COOKIEJAR, $ckfile); 
    $input = curl_exec($ch);

    # Get VIEWSTATE variable
    preg_match('/id="__VIEWSTATE" value="(.*)" \/>/i', $input, $__VIEWSTATE);   
    preg_match('/Set-Cookie: ISAWPLB{(.*)}={(.*)};/i', $input, $__COOKIES);
    preg_match('/Set-Cookie: ASP.NET_SessionId=(.*);/i', $input, $__ASPNET);

    #echo $input;

    # Set options for RDW Call
    $options = array(
        'ctl00$ctl00$PlaceHolderMainContent$PlaceHolderMainContent$txtKenteken' => '16-JS-GK',
        'ctl00%24ctl00%24PlaceHolderMainContent%24PlaceHolderMainContent%24btnZoeken' => 'Zoeken',
        '__VIEWSTATE' => $__VIEWSTATE[1],
        '__EVENTTARGET' => '',
        '__EVENTARGUMENT' => ''
    );

    #echo file_get_contents($ckfile);

    # Setup second URL
    $ch = curl_init("https://ovi.rdw.nl/VoertuigDetails.aspx");
    curl_setopt($ch, CURLOPT_POST, false);
    curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13');
    curl_setopt($ch, CURLOPT_POSTFIELDS, $options);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
    curl_setopt($ch, CURLOPT_HEADER, true);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_COOKIE, 'ISAWPLB{'.$__COOKIES[1].'}='.$__COOKIES[2].'; ASP.NET_SessionId='.$__ASPNET[1]);
    #curl_setopt($ch, CURLOPT_COOKIEFILE, $ckfile); 
    $data = curl_exec($ch);

    # Echo data 
    echo $data;

?>

At the first page I try to save all cookies (which works), but sending the CURLOPT_COOKIEFILE does not show up any cookies in the headers of the cURL request. Therefor I used CURLOPT_COOKIE with some preg_matches to get the cookies manually and send them along (this works).

Also the post variables are right.

However, it still complains that the service is offline when I echo $data, this could be the case of course, but when visiting the page and entering some data manually it works perfectly.

So, is there something I’m missing? I can’t seem to get the right page loaded with cURL.

Any help would be appreciated.

  • 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-05-23T06:29:46+00:00Added an answer on May 23, 2026 at 6:29 am

    Used a different source, the SSL was interfering with getting the right response. It works properly with the given example. Thanks for thinking tho.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need some help setting up a particular terrain. I have a world that
I need some help from the shell-script gurus out there. I have a .txt
Hi I need some help with the following scenario in php. I have a
I am new to all the anonymous features and need some help. I have
I'm working with jQuery for the first time and need some help. I have
i have a input tag which is non editable, but some times i need
This is my first time using a typedef enum and I need some help
I need some help programatically setting the selected item in a combobox. I've got
I need some help with properly versioning my Android project with Git/Eclipse. I have
I need some help regarding algorithm for randomness. So Problem is. There are 50

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.