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
https://forums.phpfreaks.com/topic/20333-include-photo-if-logged-in/
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]

Archived

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

×
×
  • 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.