Jump to content


Photo

Include (Photo) if logged in?


  • Please log in to reply
2 replies to this topic

#1 Gregg

Gregg
  • Members
  • PipPipPip
  • Advanced Member
  • 61 posts
  • LocationUSA

Posted 11 September 2006 - 01:37 AM

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?

<?if($UsErCoOkIe)
		  		include("Users3Rate/Gerard.gif");
			else
				include("Users3Censored/Gerard.gif");?>

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!

#2 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 11 September 2006 - 01:49 AM

.gif files are not capable of interpretation by the php engine, so:

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. "'>";

Legend has it that reading the manual never killed anyone.
My site

#3 Gregg

Gregg
  • Members
  • PipPipPip
  • Advanced Member
  • 61 posts
  • LocationUSA

Posted 11 September 2006 - 05:06 PM

You did it kid... Worked like a charm!

That's right... who's laughing now... who's laughing *now*?






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users