Hi, I am learning PHP and mySql and are quited interested in them.
Recently I come up a problem and even drag all my hair off of head, can not fix it.
I created a test.php (as follows), it has include function in it. This include function can load any non-frameset page, as the following index.html(nonframeset), but can not load any frameset page, as the following index.html(frameset). Strange enough.
Can anybody view the following code and help me to find the problem. Thank you very much.
//test.php, this page is to load proper index.html from a list
<html>
<head>
<link href="sales.css" rel="stylesheet" type="text/css">
</head>
<body>
<?
require_once("datacn_fns.php");
$query="select nsid,passwd from nsmember where nsname='$nsname'";
$result=mysql_query($query);
$row=mysql_fetch_array($result);
$nsid=$row["nsid"];
if ($row["passwd"]!==$passwd)
{
?>
<center><h1 align=center><img src="logo.gif"></h1>
<br><br><h3>Emm, the password you typed is not correct, please go back and try again</h3><br>
<input type=button value="Go Back" onClick="history.back()">
</center>
<?
}
else
{
include("./$nsname/index.html");
}
?>
</body>
</html>
//index.html (nonframeset), which has no frameset, and which can be loaded by test.php properly
<html>
<body>
<head>
<title>Home page of NS Members</title>
</head>
<h1 align=center><img src="logo.gif" alt=""></h1>
<h3><a href="../../../index.html.en" target="_top">Home Page </a></h3>
<h3><a href="./nsxchange/index.html">EVN NS Contract Exchange</a></h3>
<H3><a href="./salestest/index.html" >Seeds Division </a></h3>
<H3><a href="./vegetable/index.html">Agriculture Division</a></h3>
<h3><a href="./husbandry/index.html">Husbandry Division</a></h3>
<h3><a href="./forestry/index.html">Forestry Division</a></h3>
<h3><a href="./engineering/index.html">Engineering Division</a></h3>
<h3><a href="./RD/index.html">R & D Division</a></h3>
<h3><a href="./register/index.html">Data Admin </a></h3>
</body>
</html>
//index.html(frameset), which has frameset, which could not be loaded by test.php properly, and leave the browser window blank
<html>
<head>
<title>PenningtonPage</title>
</head>
<body>
<frameset border=5 rows="75,">
<!---company Logo--->
<frame src="logo.gif" scrolling=NO marginheight=0 noresize name=logo background="green.gif">
<!---Nested frame--->
<frameset cols="160," border=10 >
<!---List of LGF dabase seeds sales links-->
<frame src="links.html" noresize name=links >
<!--home page of LGF database-->
<frame src="intro.html" marginheight=0 marginwidth=0 noresize name=document >
</frameset>
</body>
</html>