K|NG Posted February 25, 2003 Report Share Posted February 25, 2003 Kaa lai pareizaak uztaisa? Vajag lai ielaadee bilde.jpg, bet ja reaali nav taas bildes vai serveris nestraadaa, tad ielaadee bilde2.jpg no cita servera ??? pašlaik doma ir tik tālu :) <code><font color="#000000"> <font color="#0000CC"><?php $bilde</font><font color="#006600">=</font><font color="#CC0000">'bilde.jpg'</font><font color="#006600">; </font><font color="#0000CC">$bilde2</font><font color="#006600">=</font><font color="#CC0000">'bilde2.jpg'</font><font color="#006600">; if( </font><font color="#0000CC">is_file </font><font color="#006600">(</font><font color="#0000CC">$bilde</font><font color="#006600">)){ echo </font><font color="#CC0000">"<img src='$bilde'>"</font><font color="#006600">; } else {echo </font><font color="#CC0000">"<img src='$bilde2'>"</font><font color="#006600">;} </font><font color="#0000CC">?></font> </font> </code> :blink: Link to comment Share on other sites More sharing options...
capsx Posted February 25, 2003 Report Share Posted February 25, 2003 viss jau pareizi me vieniigi uusa file_exists Link to comment Share on other sites More sharing options...
Kaklz Posted February 25, 2003 Report Share Posted February 25, 2003 viss jau pareizime vieniigi uusa file_exists ar remote servuchiem vareetu gadiities probleemas .. un cik sapratu no jautaajuma, tad tieshi tas arii cilveekam ir vajadziigs .. ;) Link to comment Share on other sites More sharing options...
K|NG Posted February 25, 2003 Author Report Share Posted February 25, 2003 viss jau pareizime vieniigi uusa file_exists ar remote servuchiem vareetu gadiities probleemas .. un cik sapratu no jautaajuma, tad tieshi tas arii cilveekam ir vajadziigs .. ;) A kā tad lai dara :huh: ? pašlaik man ir šitā: <code><font color="#000000"> <font color="#0000CC"><?php $bilde </font><font color="#006600">= </font><font color="#CC0000">'bilde.jpg'</font><font color="#006600">; </font><font color="#0000CC">$bilde2 </font><font color="#006600">= </font><font color="#CC0000">'bilde2.jpg'</font><font color="#006600">; if ( </font><font color="#0000CC">file_exists </font><font color="#006600">(</font><font color="#0000CC">$bilde</font><font color="#006600">)){ </font><font color="#0000CC">$size </font><font color="#006600">= </font><font color="#0000CC">GetImageSize </font><font color="#006600">(</font><font color="#0000CC">$bilde</font><font color="#006600">); echo </font><font color="#CC0000">"<img src='$bilde' $size</font><font color="#006600">[</font><font color="#CC0000">3</font><font color="#006600">]</font><font color="#CC0000"> alt='$bilde'>"</font><font color="#006600">;} else { </font><font color="#0000CC">$size2 </font><font color="#006600">= </font><font color="#0000CC">GetImageSize </font><font color="#006600">(</font><font color="#0000CC">$bilde2</font><font color="#006600">); echo </font><font color="#CC0000">"<img src='$bilde2' $size2</font><font color="#006600">[</font><font color="#CC0000">3</font><font color="#006600">]</font><font color="#CC0000"> alt='$bilde'>"</font><font color="#006600">;} </font><font color="#0000CC">?> </font> </font> </code> nezinu kā lai tur tos array labi pielieto, ja $bilde ir vairākas ? :blink: Ko lai dara ar šitiem is_file vai file_exists ? Link to comment Share on other sites More sharing options...
Recommended Posts