"CURLOPT_URL =>" Not pulling Parameter in middle of URL String

Viewed 19

CURLOPT_URL => "https://api.airdeed.com/v1.1/client/property/.$_POST{'ID'}/historical?state=".$_POST['state'],

When a form on the website is submitted to retrieve API data with added "ID" and "State". It's not pulling in the ID and just hangs.

Have no issue getting others to work when all parameters are at the end of string but with this "ID" being in the middle. I'm not sure what it should look like

Thanks

1 Answers

You were close. Just a couple of typos.

CURLOPT_URL => "https://api.airdeed.com/v1.1/client/property

/.$_POST{'ID'}/historical?state=".$_POST['state'],

The above is missing a double quote before the /property/.$_POST{'ID'}

And $_POST{'ID'} should be $_POST['ID']

"https://api.airdeed.com/v1.1/client/property/.$_POST{'ID'}/historical?state=".$_POST['state'],

May work if you change it to:

"https://api.airdeed.com/v1.1/client/property/" . $_POST['ID'] . "/historical?state=". $_POST['state'],
Related