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
https://forums.phpfreaks.com/topic/219727-php-session/
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
https://forums.phpfreaks.com/topic/219727-php-session/#findComment-1139170
Share on other sites

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.