1
Good morning!! I was doing some things here and decided to put an iframe on the page, but it was loaded with the User Agent from some other browser. Just to understand the behavior of the site.
This is possible with HTML5 and Javascript?
Otherwise, can I do this with Curl in PHP? And how do I do?
I was able to do this with Curl, but I wanted to do it with iframe. The solution, in PHP, was:
<?php
$url = "http://example.com";
$ch = curl_init();
$curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Linux; U; Android 4.0.3; de-ch; HTC Sensation Build/IML74K) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30");
curl_exec($ch);
Playing all this in a DIV, I get something, but I want to do with iframe, because then I have problem with images, which I solved with a base tag, but I prefer iframe.
Are you referring to joining an iframe here on [en.so]? or on a page of your own? What do you mean "but that it was loaded with the User Agent from some other browser"?
– Sergio
Tested my suggestion with iframe Heliton?
– Fernando Leal
I tested yes, it worked as expected. Thank you very much.
– Héliton Martins
I forgot to thank you because I went to test and forgot kkkk
– Héliton Martins