PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
stuckne1
Forum Newbie
Posts: 7 Joined: Sat Nov 27, 2010 10:51 am
Post
by stuckne1 » Mon Dec 06, 2010 2:18 am
Chunk of the first page. I do have session_start(); at the top of this one too.
I do this and the session ends up empty. it's just 0 every time.
Code: Select all
if(mysql_num_rows($result) > 0)
{
$_SESSION['login_name'] = $user_loginName;
echo $_SESSION['login_name'];
echo $result;
js_redirect('http://localhost/roomSplit/loggedIn.php',1); //Redirects to blogulate.com in 1 second.
}
else
{
echo("Wrong username/password.");
}
2nd page
Code: Select all
<?php
session_start();
ini_set('display_errors',1);
error_reporting(E_ALL);
?>
<html>
<title>Panel</title>
<body>
<?php
echo("Welcome " + $_SESSION['login_name']);
?>
</body>
</html>
social_experiment
DevNet Master
Posts: 2793 Joined: Sun Feb 15, 2009 11:08 am
Location: .za
Post
by social_experiment » Mon Dec 06, 2010 3:21 am
What does the query for $result look like
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
stuckne1
Forum Newbie
Posts: 7 Joined: Sat Nov 27, 2010 10:51 am
Post
by stuckne1 » Mon Dec 06, 2010 8:55 am
fixed! Thanks.
Code: Select all
echo("Welcome " . $_SESSION['login_name']);