Jump to content

Include (Photo) if logged in?


Gregg

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!
Link to comment
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]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.