title: Google Viewer url
body: <p><strong>Task:</strong> To view the pdf in google viewer and the user cannot see the original pdf path/url in view source. So i decide to pass the pdf url in php by using session</p>
  
  <p><strong>viewer.php</strong></p>
  
  <pre><code>&lt;?php
  session_start();
  $_SESSION['url']= 'http://research.google.com/archive/bigtable-osdi06.pdf';
  ?&gt;
  &lt;iframe src="http://docs.google.com/viewer?url=http://sitename.com/pdf.php&amp;embedded=true" width="600" height="780" style="border: none;"&gt;&lt;/iframe&gt;
  </code></pre>
  
  <p><strong>pdf.php</strong></p>
  
  <pre><code>&lt;?php
  session_start();
  header('Content-type: application/pdf');
  readfile($_SESSION['url']);
  ?&gt;
  </code></pre>
  
  <p>I check in pdf.php session variable using var_dump, it return <a href="http://research.google.com/archive/bigtable-osdi06.pdf" rel="nofollow">http://research.google.com/archive/bigtable-osdi06.pdf</a> correctly, but not work in google viewer.</p>
  
  <p>But when i put the url directly yo readfile, it works. 
  eg</p>
  
  <pre><code>readfile('http://research.google.com/archive/bigtable-osdi06.pdf');
  </code></pre>
  
  <p>or</p>
  
  <pre><code>$a = 'http://research.google.com/archive/bigtable-osdi06.pdf';
  readfile($a);
  </code></pre>
  
  <p>Please help me, why session variable not work in readfile</p>
  
  <p><em>sorry, for my english</em></p>