title: cURL followlocation not working correctly
body: <p>I am currently working on a script where the user has to fill in a username and a password. Then, when the user logs in, the script checks if his/her username is registered in my database. If that is the case, the user logs in on my external website (using cURL), and if not, the user logs in on a different website of which I do not have access to the database. </p>
  
  <pre><code>if($count==1){
      $curl = curl_init('http://www.myownwebsite.com/');
      curl_setopt ($curl, CURLOPT_POSTFIELDS, "gebruikersnaam=$myusername&amp;wachtwoord=$mypassword");
      curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
      curl_exec($curl);
  }
  else {
      $curl = curl_init('http://www.differentwebsite.com/');
      curl_setopt ($curl, CURLOPT_POSTFIELDS, "username=$myusername&amp;password=$mypassword");
      curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
      curl_exec($curl);
  }
  </code></pre>
  
  <p>as you can see, my script stores the row count in a count variable, and if the query results 1 row, it logs in on my site, and if not it logs in on the other site. The username and password checking is done on the actual websites the user logs in to. </p>
  
  <p>Now my problem is, that I want it to "follow the location", or so to speak. The script, as it is right now, redirects(?) to e.g. <code>http://www.myownwebsite.com/checklogin.php</code> (checklogin.php being the script I'm using cURL in). </p>
  
  <p>I tried solving this by using the followlocation cURL function, but doing that gives me a warning:</p>
  
  <blockquote>
    <p>Warning: curl_setopt(): CURLOPT_FOLLOWLOCATION cannot be activated when safe_mode is enabled or an open_basedir is set in -----</p>
  </blockquote>
  
  <p>I checked my php.ini by using the phpinfo(); function and safemode is turned off, open_basedir has no value, so I don't think this is the problem. I looked up some other possible solutions, but nothing so far helped me solve this issue. </p>
  
  <p>If anything is unclear, feel free to ask.</p>