GET name attributes sent using API


I’m so close into getting the API to work correctly with a Virtuagym enrollment form.

I just cant seem to link the HTML ´name´ attibutes I gave each input field to get sent through my API.

My question basically is: why does this work:

$fname = "John"; 
$lname = "Doe";
$email = ""; 

But doesnt this work:

$fname = $_GET['roepnaam']; 
$lname = $_GET['last_name'];
$email = $_GET['e-mail'];

The names inside the brackets are the names in the HTML field names.

I have no clue what should be filled after $fname = … Please advice.

Complete API (fake keys etc) as shown below.


define('API_URL', ''); 
define('API_KEY', 'MzuwtwgsAEXhNglVc0I7zVUWju1INauUwiV62XXX1rt'); 
define('CLUB_ID', '12521'); 
define('CLUB_KEY', 'CS-12521-ACCESS-7ilUAlrEiNC8PbGCylUVf0uXX'); 

$fname = $_GET['roepnaam']; 
$lname = $_GET['last_name']; 
$mail= $_GET['e-mail']; 

$customer_data = array( 
    "firstname" => $fname, 
    "lastname" => $lname, 
    "email" => $mail,

$data_string = json_encode($customer_data); 
$url = API_URL.'club/'.CLUB_ID.'/member?api_key='.API_KEY.'&club_secret='.CLUB_KEY; 
$ch = curl_init($url); 
curl_setopt_array($ch, array( 
        CURLOPT_POSTFIELDS => $data_string, 
        CURLOPT_SSL_VERIFYPEER => false // not the best way, but it works (might want to validate the certificate) 
$result = curl_exec($ch); 
$response = json_decode($result); 
echo 'Response: <br /><br />'; 
echo '<pre>'; 
echo '</pre>'; 

get_footer(); ?>

Thank you!