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

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -