I want to read data from a website with cURL but from a certain user logged in with a session. I don’t know cURL but I’ll be reading the documentation on php.net tonight.
Can this be done? I don’t have access to the database on the server but I have a php script on it, so I want to get the username of the user that is logged in.
Use curl_setopt() coupled with the
CURLOPT_COOKIEoption to set thePHPSESSIDcookie:Optionally, if your server allows
PHPSESSIDto be passed as aGETparameter in the URL, you could just appendPHPSESSID=123456to the URL and not bother with a cookie.