title: Setting a User Agent for an iFrame
body: <p>I would like to set a User Agent for an iFrame as iPhone. I found this code:</p>
  
  <pre><code>navigator.__defineGetter__('userAgent', function(){
  return 'foo' // customized user agent
  });
  
  navigator.userAgent; // 'foo'
  </code></pre>
  
  <p><a href="https://stackoverflow.com/questions/5426899/creating-a-proxy-to-spoof-iphone-user-agent-in-php/6630823#6630823">from here</a>.</p>
  
  <p>I am wondering how to insert this with my code:
  PHP/HTML:</p>
  
  <pre><code>&lt;div class="holder"&gt;
  &lt;form action="page.php" method="post"&gt;
  &lt;label&gt;
  http://
  &lt;/label&gt;
  &lt;input type="text" name="url" value="&lt;? echo $_POST['url']; ?&gt;" /&gt;
  &lt;input type="submit" value="Anschauen" /&gt;
  &lt;/form&gt;
  &lt;/div&gt;
  &lt;div class="iphone"&gt;  
  &lt;iframe src="&lt;? echo 'http://'. $_POST['url']; ?&gt;"&gt;&lt;/iframe&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>If the above script doesn't work is there any possibility to use AJAX or cURL, if yes could anyone give an example for my code, since I don't know how to code AJAX or cURL.</p>