title: PHP cURL HTTP-Authentication to let user into password protected directory?
body: <p>I am building a prototype of a web app for a client, using axure - which is all front-end code (html/css/js files) - no php at all, so i can't use php authentication (sessions, etc) within the prototype itself.</p>
  
  <p>So to protect it, the prototype is in a password-protected directory on my server (using htaccess / basic HTTP Authentication), so my client must login to review it.</p>
  
  <p>But instead of requiring him to login through the ugly browser-based login-box, I'd LOVE to somehow use PHP to login for him, since he'll already be logged into my client-portal (Wordpress) site. </p>
  
  <p>I setup a PHP page outside the prototype directory, and used cURL to hit the prototype's start-page (/project04/start.html) -- and successfully authenticate. But I can't then use cURL to load and display the content from start.html onto that php page, because all the paths (for assets and links) in the prototype become wrong (and there's a ton of JS that might be problematic too).</p>
  
  <p>I tried using header(Location: project04/start.html) in the php, after the cURL login, but that didn't work - the redirect just triggered the ugly http-auth login box again.</p>
  
  <p>Is there any way to use PHP to login, and then let the user into the protected directory, to browse around the prototype?</p>
  
  <p>Alternatively, the prototype works great embedded into an iframe (on a php page of my Wordpress site). But then the prototype directory itself is not actually protected from direct viewing - it's just hidden. I tried moving it outside my document-root, as a way to protect it without htaccess-auth, but then the paths are all bad again.</p>
  
  <p>Any help super appreciated.
  Thanks!</p>