Forums
This topic is locked
Customizing My USer Login Database
Posted 10 Apr 2003 13:20:03
1
has voted
10 Apr 2003 13:20:03 Matt Canning posted:
<font face='Comic Sans MS'>Hiya people what can i do once i hvae done it? how can i put a welcome ( then followed by the username ) and do you know some good sites where i can find amazing scripts </font id='Comic Sans MS'>HELP ME WITH MY SITE
Replies
Replied 11 Apr 2003 00:25:48
11 Apr 2003 00:25:48 Michael O'Neill replied:
Hi, this code will will show either "Welcome username" or "Welcome Visitor" depending on whether the user is logged in or not.
Hope this helps!
Mike.
<?php
// *** Start the session
session_start();
?>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<?php
if(session_is_registered("KT_Username")
{
?>
Welcome
<?php echo $KT_Username?>
<?php
}
else
{
?>
<font size="3"><b> Welcome Visitor</b></font>
<?php
}
?>
</body>
</html>
Hope this helps!
Mike.
<?php
// *** Start the session
session_start();
?>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<?php
if(session_is_registered("KT_Username")
{
?>
Welcome
<?php echo $KT_Username?>
<?php
}
else
{
?>
<font size="3"><b> Welcome Visitor</b></font>
<?php
}
?>
</body>
</html>
Replied 11 Apr 2003 12:12:21
11 Apr 2003 12:12:21 Julio Taylor replied:
just a small followup-
whenever you're using KT_Username session-based variables you need to run the session_start() code block as carphone wrote:
<pre id=code><font face=courier size=2 id=code>
<?php
// *** Start the session
session_start();
?>
</font id=code></pre id=code>
a lot of people get stumped on this. it needs to go at the top of your document, as it needs to be executed before you recall any session vars.
------------------------
Julio
PHP | MySQL | DWMX
ICQ: 19735247
MSN:
whenever you're using KT_Username session-based variables you need to run the session_start() code block as carphone wrote:
<pre id=code><font face=courier size=2 id=code>
<?php
// *** Start the session
session_start();
?>
</font id=code></pre id=code>
a lot of people get stumped on this. it needs to go at the top of your document, as it needs to be executed before you recall any session vars.
------------------------
Julio
PHP | MySQL | DWMX
ICQ: 19735247
MSN: