Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Pogoda, problem skrypt pogody
Qel
post
Post #1





Grupa: Zarejestrowani
Postów: 5
Pomógł: 0
Dołączył: 10.05.2005

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


Witam mam problem znalazlem skrypt pogody chcialem go dodaj na stronie ale jak dodaje do tabelki to mi sie robi kolejna tabelka i sie wszystko knoci

  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.1\r\n";
  7. $out .= "Host: pogoda.onet.pl\r\n";
  8. $out .= "Connection: Close\r\n\r\n";
  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. ?>


czekam na wasze pomysly
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
crash
post
Post #2





Grupa: Przyjaciele php.pl
Postów: 2 196
Pomógł: 2
Dołączył: 17.01.2004
Skąd: Sosnowiec

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


A wystarczy troszeczkę tylko pomyśleć...

  1. <?php
  2. echo '<table>' . $s2 . '</td></table>';
  3. ?>
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: 7.10.2025 - 21:58