All in my mind is to shift in secure coding, so I’m studying OOP PDO in php. Then here is the stuff they called cURL, I’ve heard it many times but this is just the time I pay attention to it. After searching about it, there is a question bugging in my mind,
WHEN TO USE cURL? I’m now working on an inventory system.
This is my first project. All I want is a fast and secure application,
can this be helpful in my project?
Use cURL when you want to grab something from another website.
You can use cURL to help you negotiate your way into a site which may require a POST or a GET submission with say a user/password and even cookies.
Go in, get the response (usually though not always, a html stream) cache the output on your server then analyse the output to extract what you want.
You might also grab the output of an API, or just try and detect the return code, 200, 404 or whatever.
This is the main reason I have used it. Does that help you?
Just a side note, as it’s come up a few times recently:
Make sure you have permission to pull data from the other website.
Most websites explicitly forbid people to copy/‘scrape’ their data.
makes a little bit clearer now. So if my project doesn’t have to do with other website, I don’t need it anymore.
Thank you for the responses!