Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [php] pogoda
nib
post
Post #1





Grupa: Zarejestrowani
Postów: 19
Pomógł: 0
Dołączył: 23.12.2006

Ostrzeżenie: (0%)
-----


Szukam skryptu aby pokazywal aktualna pogode cos ala tu:
http://www.coneyislandarcade.ehost.pl/CMS/test.php
Niestety szukalem w google i tu znalazem takie cos:
Przeobic tego juz nie potrafilem prosze o pomoc!

  1. <?
  2. $fp = fsockopen("pogoda.onet.pl", 80, $errno, $errstr, 30);
  3. if (!$fp) {
  4. echo "$errstr ($errno)<br />n";
  5. } else {
  6. $out = "GET /0,13057,38,miasto.html HTTP/1.1rn";
  7. $out .= "Host: pogoda.onet.plrn";
  8. $out .= "Connection: Closernrn";
  9.  
  10. fputs($fp, $out);
  11. $st="";
  12. while (!feof($fp)) {
  13. $st.= fgets($fp, 128);
  14. }
  15. fclose($fp);
  16. }
  17. $teraz=strpos($st,"class=a2b><IMG src=0 width=14 height=14></TD></TR><TR>");
  18. $end=strpos($st,"BR><IMG src=0 width=6 height=6 border=0></TD></TR><TR>");
  19. $ile=$end-$teraz;
  20. $s2=substr($st,$teraz,$ile-1);
  21. $s2=str_replace("_d/","http://pogoda.onet.pl/_d/",$s2);
  22. $s2=str_replace("<TD class=a1b width="100%">","<TD class=a1b>",$s2);
  23. $s2=str_replace("<BR><IMG src=0 width=2 height=2 border=0><BR>"," ",$s2);
  24. $teraz=strpos($s2,"<TD align=center");
  25. $s2=substr($s2,$teraz);
  26. echo"$s2";
  27. ?>
Go to the top of the page
+Quote Post

Posty w temacie


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

 



RSS Aktualny czas: 21.08.2025 - 07:17