title: Codeigniter: Redirect to another URL from view page
body: <p>google-php-client example calls the authorization URL when user clicks a link. I want to call it when page loads without any user click.
  The way it is implemented in google-client example:</p>
  
  <pre><code>$client = new Google_Client();
  $client-&gt;setApplicationName('Google Contacts PHP Sample');
  $client-&gt;setScopes("http://www.google.com/m8/feeds/");
  $auth = $client-&gt;createAuthUrl();
  print "&lt;a class=login href='$auth'&gt;Connect Me!&lt;/a&gt;";
  </code></pre>
  
  <p>I am trying to remove dependency on clicking on <code>Connect Me</code> link and call url given by <code>$client-&gt;createAuthUrl()</code>. I am new to Codeigniter that's why struggling on this simple task.<br/>
  I check that there are following different ways to call an URL but not sure which one will work here:</p>
  
  <ol>
  <li>cURL</li>
  <li>file_get_contents</li>
  <li>stream_context_create</li>
  </ol>
  
  <p>I am using php 5.3 with XAMPP</p>