Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP][HTML] Zamiana IFRAME cna CURL
arkos
post
Post #1





Grupa: Zarejestrowani
Postów: 93
Pomógł: 0
Dołączył: 24.12.2009

Ostrzeżenie: (20%)
X----


Mam problem z jednym jak zastąpić iframe funkcją curl. Męczę już się z tym długo i nie umię sobie poradzić (IMG:style_emoticons/default/sad.gif) ?
Mam taki link:
  1. echo '<iframe src=http://'.$row['ip'].':'.$row['port'].'/admin.cgi?mode=updinfo&pass='.$row['haslo'].'&song='.$tekst.'></iframe><br />';

Pozdrawiam,
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
neverever
post
Post #2





Grupa: Zarejestrowani
Postów: 278
Pomógł: 44
Dołączył: 17.02.2004
Skąd: Wieliczka

Ostrzeżenie: (10%)
X----


Najprościej
  1.  
  2. function geturl($url){
  3. $curl = curl_init();
  4. curl_setopt($curl, CURLOPT_URL, $url);
  5. curl_setopt($curl, CURLOPT_USERAGENT, 'Googlebot/2.1 (+http://www.google.com/bot.html)');
  6. curl_setopt($curl, CURLOPT_REFERER, 'http://www.google.com');
  7. curl_setopt($curl, CURLOPT_AUTOREFERER, true);
  8. curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
  9. curl_setopt($curl, CURLOPT_TIMEOUT, 10);
  10. $html = curl_exec($curl);
  11. curl_close($curl);
  12. return $html;
  13. }
  14.  
  15. $url='http://'.$row['ip'].':'.$row['port'].'/admin.cgi?mode=updinfo&pass='.$row['haslo'].'&song='.$tekst;
  16.  
  17. echo geturl($url);


Tylko czy musi vyc koniecznie curl? nie wystarczy file_get_contents() ?
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 8.10.2025 - 05:44