I just purchased WHMCS along with the FreeRadius module and I need to insert some speed values into the radreply table of my Radius database.
I'm new to PHP and I'm not sure how to pull the correct value out of the array and insert it into the database.
I have the insert function working fine, it's just these two fields that continue to be blank. So I know that I'm not calling it correctly which explains why the field is blank.
I have not decided which to use yet so I've been trying both custom fields and Configurable options and of course nether will work as by skills are not up to par.
Based on what Matt has told me so far, the custom fields are passed into the function as an array in the $params["customfields"] variable, for example "Upload Speed" would be $params["customfields"]["Upload Speed"]
Can I also assume that the configurable options passed the same way except they would use
$params["configoptions"].
So how do you include either of these into the module and then call it so that the database insert will pull the correct value and insert it in the proper location.
So far this is what I have for the configoptions test, so far and of course it's not working,
$configoptions = $params["configoptions"]; # Array of configurable option values for the product
extract($configoptions);
# Product module option settings from ConfigOptions array above
$configoptions1 = $params["configoptions1"];
$configoptions2 = $params["configoption2"];
$configoptions3 = $params["configoption3"];
$configoptions4 = $params["configoption4"];
Then to insert I have
$query = "INSERT INTO radreply (username,attribute,value,op) VALUES ('$username','WISPr-Bandwidth-Max-Down','$configoption[1]',':=')";
$query = "INSERT INTO radreply (username,attribute,value,op) VALUES ('$username','WISPr-Bandwidth-Max-Up','$configoption[2]',':=')";
Any help at all would be appreciated
Thanks in advance
-Cheers