Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [php]zdjecie wariuje, jest ale go nie ma
Fixus
post
Post #1





Grupa: Zarejestrowani
Postów: 295
Pomógł: 9
Dołączył: 8.02.2006

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


Witam

problem polega na tym, że podaje ścieżkę bezwględną do zdjęcia(muszę taką podać)
http://strona.pl/admin/katalog/podkatalog/zdjecie.jpg

i teraz tak:
jak przypisze to do zmiennej
Kod
$zdjecie = 'http://strona.pl/admin/katalog/podkatalog/zdjecie.jpg';

a potem dam
Kod
if(file_exists($zdjecie)) {
echo "<img src='$zdjecie' />";
}

to zdjęcie nie wyświetla...jak pomine instrukcję warunkową to wyświetla ;/ Problem w tym, że ta instrukcja warunkowa musi być i nie wiem co jest nie tak

Ten post edytował Fixus 24.07.2007, 08:12:04
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
thornag
post
Post #2





Grupa: Zarejestrowani
Postów: 504
Pomógł: 2
Dołączył: 31.03.2006
Skąd: Londyn

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


Cytat
Description
array file ( string $filename [, int $flags [, resource $context]] )

Reads an entire file into an array.

Note: You can use file_get_contents() to return the contents of a file as a string.

Return Values

Returns the file in an array. Each element of the array corresponds to a line in the file, with the newline still attached. Upon failure, file() returns FALSE.


Rzeczywiscie Twoj sposob jak najbardziej zadziala, ale poza dzialaniem to nie bedzie to poprawne, po co wczytywac ten plik do pamieci jesli ty chcesz tylko sprawdzic czy istnieje. Zrob to jak podalem, ale w podobny sposob uzywajac do tego odpowiednich funkcji a nie funkcji ktore mimo iz zadanie spelnia nie sa do tego przeznaczone (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)
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: 4.10.2025 - 05:49