PHP cURL "CURLOPT_USERPWD" or best way to protect the API? -
in php curl usage, curlopt_userpwd
working? can see in many examples, like:
curl_setopt($ch,curlopt_userpwd,"my_username:my_password");
.. how @ server side? username
, password
? of course since want protect php api page @ server side, best way or best way protect please?
ideally, have separate config class contained user name , password. create new version of config class in file curl commands. pass username , password variables curl commands. curl information not visible anyway long not echoed or printed. if put in directly hidden, having in config file allow change values without changing main page contains curl commands.
Comments
Post a Comment