title: PHP Curl - Redirect after login
body: <p>I wanted to get data from a website with curl.
  First I login like this:</p>
  
  <pre><code>$userAgent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.4) Gecko/20060508 Firefox/1.5.0.4"; 
  
  $ch = curl_init("https://192.168.67.10/Appliance/index.jsp"); 
  
  $username="***"; 
  $password="***"; 
  $submit = "userid=$username&amp;pass=$password&amp;submitted=true&amp;rememberMe=0";
  
  if(!$ch) { 
      die(sprintf("Fehler[%d]: %s", 
          curl_errno($ch), curl_error($ch))); 
  } 
  curl_setopt($ch, CURLOPT_VERBOSE, 1); 
  curl_setopt($ch, CURLOPT_HEADER, 1); 
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
  curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0); 
  curl_setopt($ch, CURLOPT_COOKIEJAR, "/tmp/cookie.txt");  
  curl_setopt($ch, CURLOPT_USERAGENT, $userAgent); 
  curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); 
  curl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, 1); 
  curl_setopt($ch, CURLOPT_POSTFIELDS, $submit);
  
  $data = curl_exec($ch); 
  
  if(!$data) { 
      die(sprintf("Fehler [%d]: %s", 
          curl_errno($ch), curl_error($ch))); 
  
  } 
  
  curl_close($ch); 
  
  echo $data;
  </code></pre>
  
  <p>How can I access another page now?</p>
  
  <p>Login page: <code>https://192.168.67.10/Appliance/HomePage/index.jsp</code>
  Page I want to access: <code>https://192.168.67.10/Appliance/SystemsCenter/Encryption/CertificateStore/index.jsp</code></p>
  
  <p>Thank you in advance.</p>