[Release] User,Guest

Mortred

Active Member
Joined
Jun 11, 2008
Messages
647
Reaction score
182
Code:
<?

$user = $_SESSION['user'];
$credits = "Select credits From MEMB_CREDITS where memb___id='$user'";
$checkcredits = mssql_query( $credits );
$row = mssql_fetch_row($checkcredits);

if (isset($user))
{
echo "Welcome $user you have $row[0] Credits in Webshop!";
}
else 
{
echo "Welcome Guest "; 
}
?>
Credits: Mortred
 
Last edited:
Браво добре е но ако сесията не е user тогава няма да го покаже.

И един съвет. Използвай code beautifer доста по-прегледно е.

PHP:
<?
$user = $_SESSION['user'];
$credits = "Select credits From MEMB_CREDITS where memb___id='$user'";
$checkcredits = mssql_query($credits);
$row = mssql_fetch_row($checkcredits);

if (isset($user))
{

    echo "Welcome $user you have $row[0] Credits in Webshop!";
}
else
{
    echo "Welcome Guest ";
}
?>
 
  • Like
Reactions: Mortred
Ей тоз Дидо ей и той почна да прави шантави работи :)