Including a PHP File: cURL, Pathing, and Security Risks -
So I've heard a lot about the security hazards curls. I have to know what I am doing, security threats can happen, and if so, how can I stop it?
Through the host gate, I have my own VPS (Virtual Private Server).
Actually I am trying to include a file from a different domain. Both domains are in the same server. I tried to use the full path to include the file, but I'm getting permission denied error.
This is the code that contains the file using cURL:
$ Url = "http://mydomain.com/include.php"; $ Ch = curl_init (); Curl_setopt ($ ch, CURLOPT_URL, $ url); Curl_setopt ($ CH, CURLOPT_HEADER, 0); Curl_exec ($ ch); Curl_close ($ ch); Is this a security risk? If so, how can I stop this security risk?
In addition, how can I set the permissions on the domain so that I can include a PHP file from another domain on the same server?
If you are loading data from different domains, You can use the path but you can neither take the php file url and its recommended.
Comments
Post a Comment