suport Posted January 16, 2010 Report Share Posted January 16, 2010 (edited) echo "<img src='forums/uploads/$bilde' alt='' width='100' height='100'>"; } else { echo "<img src='http://kkas/no_avatar.gif' alt='' width='100' height='100'>"; } straa tikaj echo "<img src='forums/uploads/$bilde' alt='' width='100' height='100'>"; so vienu ieliek .. bet man vajag ta lai ja nav avatara tad radas noavatar bilde ! Edited January 16, 2010 by suport Quote Link to comment Share on other sites More sharing options...
waplet Posted January 16, 2010 Report Share Posted January 16, 2010 a kur ir if? Quote Link to comment Share on other sites More sharing options...
briedis Posted January 16, 2010 Report Share Posted January 16, 2010 Un? Kā tu vari zināt, vai ir avatars, vai nav? Kādā mainīgajā viņš glabājas? Tu jau te iekopēji kaut kādu if konstrukciju bez paša if'a nosacījuma, kur arī tiek izštukots, vai eksistē avatars, vai nē... Varbūt noder funkcija - file_exists() Quote Link to comment Share on other sites More sharing options...
suport Posted January 16, 2010 Author Report Share Posted January 16, 2010 Un? Kā tu vari zināt, vai ir avatars, vai nav? Kādā mainīgajā viņš glabājas? Tu jau te iekopēji kaut kādu if konstrukciju bez paša if'a nosacījuma, kur arī tiek izštukots, vai eksistē avatars, vai nē... Varbūt noder funkcija - file_exists() paldies , viss sanaca :) Quote Link to comment Share on other sites More sharing options...
suport Posted January 16, 2010 Author Report Share Posted January 16, 2010 a ne tomer neaizgaja gan .. if (file_exists($bilde)) { echo "$bilde = ($avatar2['avatar_location']); <img src='forums/uploads/$bilde' alt='' width='100' height='100'>"; } else { echo "<img src='http://.../no_avatar.gif' alt='' width='100' height='100'>"; } radas tikaj no_avatar Quote Link to comment Share on other sites More sharing options...
briedis Posted January 16, 2010 Report Share Posted January 16, 2010 a ne tomer neaizgaja gan .. if (file_exists($bilde)) { echo "$bilde = ($avatar2['avatar_location']); <img src='forums/uploads/$bilde' alt='' width='100' height='100'>"; } else { echo "<img src='http://.../no_avatar.gif' alt='' width='100' height='100'>"; } radas tikaj no_avatar Varbūt norādi bildei pareizo ceļu? forums/upload/$bilde? Quote Link to comment Share on other sites More sharing options...
suport Posted January 16, 2010 Author Report Share Posted January 16, 2010 ir jau noradiits pareizas celsh ! Quote Link to comment Share on other sites More sharing options...
briedis Posted January 16, 2010 Report Share Posted January 16, 2010 ir jau noradiits pareizas celsh ! Toč zini? Pārbaudi divreiz! Quote Link to comment Share on other sites More sharing options...
suport Posted January 16, 2010 Author Report Share Posted January 16, 2010 http://paste.php.lv/413fb56bfe255fcd4fadf48ae888e37a?lang=php reku vis sakums .. varbut tur ir kada kluuda ? nu ir kapec tad man ja es nelieku to fileexist izvelk ? echo "<img src='/forums/uploads/$bilde' alt='' width='100' height='100'>"; ar sho .. bet kad pieliek klat if ..} else { ... tad nejiet ! rada tikaj no avatar ! bildi ! Quote Link to comment Share on other sites More sharing options...
waplet Posted January 16, 2010 Report Share Posted January 16, 2010 pamegjini file_exist aizstaat ar !empty Quote Link to comment Share on other sites More sharing options...
Pentiums Posted January 16, 2010 Report Share Posted January 16, 2010 (edited) echo (file_exists('forums/uploads/'.$bilde) ? '<img src="/forums/uploads/'.$bilde.'" alt="" width="100" height="100" />' : '<img src="/no_avatar.gif" alt="" width="100" height="100" />'); P.S. Pamēģini norādīt pilno ceļu uz failu iekš file_exists funkcijas! (/var/www/tavs_webs/blablabla/forums/uploads/.....) Edited January 16, 2010 by Pentiums Quote Link to comment Share on other sites More sharing options...
suport Posted January 16, 2010 Author Report Share Posted January 16, 2010 pamegjini file_exist aizstaat ar !empty Tnx , tagad gan aizgaaja :) Quote Link to comment Share on other sites More sharing options...
briedis Posted January 16, 2010 Report Share Posted January 16, 2010 nu jā, sapratu problēmu. Jebkurā gadījumā file_exist būtu true, jo ja nav galā piekabināts faila nosaukums, direktorija tak eksistē tāpat :)) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.