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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T03:36:30+00:00 2026-05-30T03:36:30+00:00

As mentioned in my previous question I read about cURL and how to work

  • 0

As mentioned in my previous question I read about cURL and how to work with it. I got the request with the following API: api.openkvk.nl (it’s in Dutch, sadly enough) working:

$get = $_POST['bedrijfsnaam'];
$get = str_replace(" ","%20",$get);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://api.openkvk.nl/php/SELECT%20*%20FROM%20kvk%20WHERE%20bedrijfsnaam%20=%20'$get'%20LIMIT%201;");
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
print("<pre>"); print_r($result); print("</pre>");
$kvks = $result[0]["RESULT"]["ROWS"][0][2];
echo $kvks; 
curl_close($ch);

and I got the results back in the following form:

array(array("RESULT"=>array("TYPES"=>array("bigint","varchar","int","int","varchar","varchar","varchar","varchar","varchar","varchar","bigint","varchar","decimal","decimal","date"),"HEADER"=>array("kvk","bedrijfsnaam","kvks","sub","adres","postcode","plaats","type","status","website","vestiging","rechtsvorm","lat_rad","lon_rad","anbi"),"ROWS"=>array(array("526937320000","Unicmedia","52693732","0","Terschellingstraat 12","1825ND","Alkmaar","Hoofdvestiging",NULL,NULL,"22611126",NULL,NULL,NULL,NULL)))))

What I want to do is the following:

Put this values from the database: kvks, adres, postcode and plaats in a form (so that I can edit them).

I don’t know how to do this. Could you give me an explanation?

PS I’m new with API’s so I don’t understand everything yet.

  • 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-30T03:36:32+00:00Added an answer on May 30, 2026 at 3:36 am

    Update:

    Their API is returning it as a php string – change the part of your URL which says /php/ to /json/.

    Then, make it so you have $result = json_decode(curl_exec($ch), true);

    Now the array access should work.


    To get the value of kvks, supposing the value you posted is the in $result, you’d use $kvks = $result[0]["RESULT"]["ROWS"][0][2].

    (It looks like you’re posting the result of a print_r – try encasing it in <pre> tags when you display it for a much more formatted result)

    Since you have PHP getting the values, you could simply output an HTML form with them prefilled:

    <form action="savedata.php" method="post">
    <?php
        echo "<input type='text' name='blah' value=\"" . htmlspecialchars($blah) ."\"><br>";
     ?>
    

    Then, if $blah is asdf, this would output <input type='text' name='blah' value="asdf">.

    When you submit it to your savedata.php method, you’d insert the modified values (now found through $_POST['blah']) into your database however you like.

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

Sidebar

Related Questions

I asked a previous question about serialization and validation. Someone mentioned using the JSON
In a previous question I mentioned some work with a 3rd party DLL whose
On the following answer to a previous question someone mentioned an auto-casting bool I
As I've mentioned in a previous question , I'm looking into migrating our source
In a previous SO question, it was mentioned that USB devices can be mounted
I have a model with 3 properties, as I mentioned in a previous question
Based on a previous question, where I asked about IDEs to support development in
I read some useful posts here on SO about previous maven questions, I'm currently
(For those who read my previous question, this is the same teacher and the
The VXML application I mentioned in a previous question is now in testing. After

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.