Gregg Posted September 11, 2006 Share Posted September 11, 2006 Ok, i am trying to make it so if a user isent logged in the image will show thecensored version.I have 2 foldes for the photos, "One unedited" & "One Censored" but i keeps loading "THE IMAGE CODE" and errors?[code]<?if($UsErCoOkIe) include("Users3Rate/Gerard.gif"); else include("Users3Censored/Gerard.gif");?>[/code]Theni heard you cant use that function on images? Anyone got and an ideah how to fix this or why it keeps loading the image code and not the image! Link to comment https://forums.phpfreaks.com/topic/20333-include-photo-if-logged-in/ Share on other sites More sharing options...
AndyB Posted September 11, 2006 Share Posted September 11, 2006 .gif files are not capable of interpretation by the php engine, so:[code]if ($UsErCoOkIe) { $img_src= "whatever.gif..."; // presumably a function of the user name} else { $img_src= "whatever_else.gif ...";//presumably a function of the user name}echo "<img src='". $img_src. "'>";[/code] Link to comment https://forums.phpfreaks.com/topic/20333-include-photo-if-logged-in/#findComment-89580 Share on other sites More sharing options...
Gregg Posted September 11, 2006 Author Share Posted September 11, 2006 You did it kid... Worked like a charm![quote]That's right... who's laughing now... who's laughing *now*?[/quote] Link to comment https://forums.phpfreaks.com/topic/20333-include-photo-if-logged-in/#findComment-89894 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.