Jump to content

PHP session?


Hrvoje

Recommended Posts

Pls tell me what is wrong?

 

<?PHP
include("dba.php");

function hvataj ($trazi, $id)
{
$upit = mysql_query ('select * from administrator where member_id = '.$id.'');

return ( $row = mysql_fetch_assoc ($upit)  ) ? $row[$trazi] : mysql_error ();
}
?> 

 

I have parse error here on this line when I want to echo it:

 

<?PHP echo "<img src='images/korisnik_slike/".hvataj('slika',$_SESSION['member_id']."' />"; ?>

Link to comment
Share on other sites

Many thanks for this ) close.

 

But I have another question.

 

Now I have that simple script, when admin loged in than echo avatar of that admin.

 

Nothing happens??

 

<?php

include("dba.php");

function hvataj ($trazi, $id){

if(!$_SESSION['member_id']){

$upit = mysql_query ('select * from administrator where member_id = '.$id.'');

return ( $row = mysql_fetch_assoc ($upit)  ) ? $row[$trazi] : mysql_error ();
} 

?>



<?php

echo "<img src='images/slika_korisnik/".hvataj('slika',$_SESSION['member_id'])."' width='82' height='82' />"; 

?>


<?PHP
}
?>

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.