Jump to content

Archived

This topic is now archived and is closed to further replies.

Gregg

Include (Photo) if logged in?

Recommended Posts

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!

Share this post


Link to post
Share on other sites
.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]

Share this post


Link to post
Share on other sites
You did it kid... Worked like a charm!

[quote]That's right... who's laughing now... who's laughing *now*?[/quote]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.