[Help]Insert an image with php

Newbie Spellweaver
Joined
Nov 25, 2004
Messages
51
Reaction score
5
is there anyway to insert an image with php?
my code looks like this...

Code:
if($session->logged_in){
   echo "<h1>logged in</h1>";

i want to replace the logged in text with a picture.. is that possible?
 
Thats because you need an ; on the end of your echo :P also,
Code:
if($session->logged_in)

shouldnt that be
Code:
if($_SESSION['logged_in'])


if i do
Code:
if($_SESSION['logged_in'])
it wont log in so im keeping it how it is that works.
i had the ; at the end and still didnt work

Code:
<?php 
if($session->logged_in){
echo "<h1>logged in</h1>"; 
   echo "Welcome <b>$session->username</b>, you are logged in. <br><br>"
       ."[<a href=\"userinfo.php?user=$session->username\">My Account</a>]   "
       ."[<a href=\"useredit.php\">Edit Account</a>]   ";
   if($session->isAdmin()){
	  echo "[<a href=\"admin/admin.php\">Admin Center</a>]   ";
   }
   echo "[<a href=\"process.php\">Logout</a>]";
}
else{
?>

is the only thing that works with no errors
 

BTW, be sure that the image you're referencing actually exists.

the file exists.. i made sure of that but i still get the error.. it dosnt matter it think ill just leave it, or is anyone gonna come out with another solution?

and i have no idea what you mean by

I think those single quotes need to be escaped...
 
Back