Forum FAQForum FAQSearchSearch MemberlistMemberlist Forum ignore listForum ignore list RegisterRegister ProfileProfile Log in to check your private messagesLog in to check your private messages Log inLog in
da li datoteka postoji (PHP)

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    mi3dot.org Forum Index -> Server-side
View previous topic :: View next topic  
Author Message
Gibbo



Joined: 26 Jul 2006
Posts: 17
Location: localhost

PostPosted: 27.07.2006 22:14    Post subject: da li datoteka postoji (PHP) Add user to your forum ignore list Reply with quote

imam gore naveden problem
kod mene lokalno sve radim, ali na serveru (SAFE MODE = ON) uvijek javlja da datoteka ne postoji. Ta mi provjera treba da znam dali da pravim male slicice ili ih vec imam generirane.

Naravno vodim racuna o velikim i malim slovima, i path je tocan(i na serveru i lokalno), ali i dalje dobivam da datoteka ne postoji osim ako su php datoteka i slika u istom folderu, e kako se radi o galeriji slika ta mogucnost ne dolazi u obzir.

Sta da radim?

primjer
Code:

<?php
if(is_file("/var/www/web344/html/Images/bilder01/tb/tb_img_0010.jpg")){
    echo "file exist<br>";
}else {
    echo "file don't exist<br>";
}


if(is_file("/Images/bilder01/tb/tb_img_0010.jpg")){
    echo "file exist<br>";
}else {
    echo "file don't exist<br>";
}


if(file_exists("/var/www/web344/html/Images/bilder01/tb/tb_img_0010.jpg")){
    echo "file exist<br>";
}else {
    echo "file don't exist<br>";
}


if(file_exists("/Images/bilder01/tb/tb_img_0010.jpg")){
    echo "file exist<br>";
}else {
    echo "file don't exist<br>";
}



?>


OUTPUT
file don't exist
file don't exist
file don't exist
file don't exist
Back to top
View user's profile Send private message Visit poster's website
Gale



Joined: 04 Apr 2005
Posts: 120

PostPosted: 27.07.2006 22:33    Post subject: Add user to your forum ignore list Reply with quote

probaj maknuti / prije Images i pazi na velika/mala slova
Back to top
View user's profile Send private message Visit poster's website
gog



Joined: 18 Jun 2004
Posts: 679
Location: zagreb

PostPosted: 27.07.2006 22:52    Post subject: Add user to your forum ignore list Reply with quote

evo ti komentar sa php.net-a za file_exists funkciju:

Quote:
file_exists under safe_mode works (I work with for php 4) doesn't work when owner of the dir where the file stands differs from the php-owner.

e.g. file_exists in this dir will give FALSE nevertheless the file exists

rights owner dir
drwxr-xr-x apache images

change the owner of the dir to the phpowner and file_exists works.

I spent too much time to discover. Hope it will spare a lot of your time


Isto je ja mislim za is_file...

p.s. Mislim da bi trebalo biti "file doesn't exist"...
Back to top
View user's profile Send private message Visit poster's website
jokla



Joined: 31 Oct 2004
Posts: 113
Location: Right behind you

PostPosted: 28.07.2006 01:02    Post subject: Add user to your forum ignore list Reply with quote

jel ne bi trebali if-ovi biti elseif ( svi osim prvog )

_________________
"If this world makes you crazy, than everything is ok with you" - ~demony
Back to top
View user's profile Send private message Visit poster's website
Gibbo



Joined: 26 Jul 2006
Posts: 17
Location: localhost

PostPosted: 28.07.2006 07:34    Post subject: Add user to your forum ignore list Reply with quote

ok probat cu
Back to top
View user's profile Send private message Visit poster's website
gog



Joined: 18 Jun 2004
Posts: 679
Location: zagreb

PostPosted: 28.07.2006 09:52    Post subject: Add user to your forum ignore list Reply with quote

jokla wrote:
jel ne bi trebali if-ovi biti elseif ( svi osim prvog )


Ne bi
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    mi3dot.org Forum Index -> Server-side All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group