Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP] Skopiowanie obrazka do folderu i wyświetlanie z lokalnego serwera
--userek--
post
Post #1





Goście







Chcę zrobic coś takiego że z serwisu shrinktheweb będzie się pobierać obrazek i zapisywać na serwerze po czym będzie się wyświetlać z serwera i mi nie działa - tzn obrazek się nie pobiera. Plik się zapisuje ale pusty.
  1. <?
  2.  
  3. $url='http://www.strona.pl';
  4.  
  5. function thumbnail($url) {
  6. $str = 'http://images.shrinktheweb.com/xino.php?stwembed=1&stwaccesskeyid=xxxxxxxxxxxxxxx&stwsize=xlg&stwurl='.$url;
  7. }
  8.  
  9. $dom_parts = parse_url($url);
  10. $thumb = 'thumb/'.$dom_parts['host'].'.jpg';
  11. if(!@file_exists($thumb)) {
  12. $request_for = thumbnail($url);
  13. @copy($request_for, $thumb);
  14. }
  15.  
  16. ?>
  17. <img src="<?php echo $thumb; ?>" border="0" />

Jestem cieniutki jeszcze z PHP i potrzebuje pomocy (IMG:style_emoticons/default/smile.gif) Co jest nie tak w tym kodzie?

Chciałem wyświetlić link obrazek nawet w tej formie:
  1. <img src="<?php echo $str; ?>" border="0" />

I dostaje tylko taki wynik:
  1. <img src="" border="0" />
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
-Gość-
post
Post #2





Goście







zrobiłem cos takiego
  1. $thumb = 'thumb/'.str_replace('.', '', $dom_parts['host']).'.jpg';


Ale plik nadal jest pusty po zapisaniu ;(
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: 3.10.2025 - 05:19