beginnerz
04-28-2005, 04:31 AM
what is goin on with my session?
session.php
session_start();
$link = mysql_connect('localhost', 'root', '123456')
or die('Error ' . mysql_errno() . ': ' . mysql_error() . '.');
$db = mysql_select_db($_SESSION['xDb'], $link)
or die('Error ' . mysql_errno() . ': ' . mysql_error() . '.');
$_SESSION['xLink'] = $link;
and in each module will have one include(session.php);
but when i click on the module....it will shows Error 1046: No Database Selected....
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
<html>
<head>
<title>web site</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<?php
include (session.php);
?>
<frameset rows="65,*" frameborder="NO" border="0" framespacing="0">
<frame src="top.html" name="topFrame" scrolling="NO" noresize >
<frame src="bottom.php" name="mainFrame">
</frameset>
<noframes><body>
</body></noframes>
</html>
session.php
session_start();
$link = mysql_connect('localhost', 'root', '123456')
or die('Error ' . mysql_errno() . ': ' . mysql_error() . '.');
$db = mysql_select_db($_SESSION['xDb'], $link)
or die('Error ' . mysql_errno() . ': ' . mysql_error() . '.');
$_SESSION['xLink'] = $link;
and in each module will have one include(session.php);
but when i click on the module....it will shows Error 1046: No Database Selected....
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
<html>
<head>
<title>web site</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<?php
include (session.php);
?>
<frameset rows="65,*" frameborder="NO" border="0" framespacing="0">
<frame src="top.html" name="topFrame" scrolling="NO" noresize >
<frame src="bottom.php" name="mainFrame">
</frameset>
<noframes><body>
</body></noframes>
</html>