Passing Hidden parameters to 3rd party website

I have been given a 3rd party API link i.e bloggs.
They are telling me that I should not make the key code visible. I have tried the following

1: To find a way to hide the address bar in a browser from within php/html
2. I have created a form with hidden variables and used the GET method and then called the page, but the parameters are added to the URL and are visible
3. I have created a form with hidden variables and used the POST method and then called the page, but the called page returns an error “Missing Key”

As I do not have access to the 3rd party webpage, I do not know how they are reading the parameters.

Can anybody help with this and is there a plug-in or php code that may help?

Does the 3rd party website not provide information on how to use their API?

They do, but it shows the construction of the call in the url, but not how to hide it in the browser. I know that you can hide your own browser address bar, but I can’t find a way of forcing it to be hidden from within php.

Use curl.

1 Like

Why would you call an API in the browser anyway? You have to call it from within your PHP script or you can’t handle any response, and as the credentials are not given by the user (what would make it obsolete to hide), you store them in some config.

I’ve never heard of curl. Is it available to use on my web hosting server? Which I think is apache based.

You’d have to check you host, but it seems to be a reasonably standard feature to have.

You should find “CURL” if you search your phpinfo().

The 3party have provided an… which brings up a certificate ready to print, so I have put that link into a button for the user to click.
What sort of php script are you suggesting?

You could just use file_get_contents() on an URL if fopen_wrappers is enabled to get the response.

This maybe relevant:

Google Maps uses an API Key which is passed by JavaScript and can be hidden:

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.