Strange PHP code problem, across frames
Posted: Wed Mar 02, 2005 3:30 pm
I'm trying to develop a login/verification script (well, set of scripts, anyway). Right now, I have a login form in one page that, when submitted, calls the PHP page. The PHP page validates the user, checks permissions, and then displays a menu, based on the permissions of the account.
That works great.
Putting this code into frames breaks my PHP for some reason - it doesn't translate as PHP, but as partial PHP and partial HTML.
Has anyone ever run into this before?
Here's the login code:
This is the PHP script:
Yes, there are "blank" functions in there right now. They are not the issue. The problem is that the PHP script works fine without frames; it is only when I try to implement frames that the problem occurs.
Can anyone help?
That works great.
Putting this code into frames breaks my PHP for some reason - it doesn't translate as PHP, but as partial PHP and partial HTML.
Has anyone ever run into this before?
Here's the login code:
Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<meta name="generator" content="Adobe GoLive">
<title>uroSpec test login page</title>
</head>
<link rel="StyleSheet" href="urospec-style.css" type="text/css" title="whatever">
<body bgcolor="#ffffff">
<form id="FormName" action="urospec.php" method="post" name="loginForm" target="top_bar">
<label>Login: </label><input type="text" name="login" size="24" tabindex="1">
<BR><label>Password: </label><input type="password" name="pw" size="24" tabindex="2"> <input type="submit" name="submitButtonName" value="Log In" tabindex="3"></p>
</form>
<p></p>
</body>
</html>Code: Select all
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<meta name="generator" content="Adobe GoLive">
<title>Urology Specialists of Coastal Georgia</title>
</head>
<link rel="StyleSheet" href="urospec-style.css" type="text/css" title="whatever">
<body>
<?
import_request_variables("P", "i_");
$hostname = "localhost";
$username = "їb]edited outї/b]";
$password = "їb]edited outї/b]";
mysql_connect($hostname, $username, $password) OR DIE("DB connection unavailable");
mysql_select_db('urospec_data');
function show($func, $image)
{
echo '<A HREF="'.$func.'"><IMG SRC="images/'.$image.'" border="0"></A><BR>';
}
function addUser()
{
echo "Add user.<BR>";
}
function addBlog()
{
echo "Add Blog menu.<BR>";
}
function adminMenu()
{
echo "Admin menu.<BR>";
show ('viewData', 'dataimg.jpg');
show ('addUser', 'adduser.jpg');
show ('addBlog', 'addblog.jpg');
}
function userMenu()
{
echo "User menu.<BR>";
}
function viewData()
{
echo "Viewdata menu.<BR>";
}
function verifyUser($i_login, $i_pw)
{
$loginquery = 'select * from users where u_name = "'.$i_login.'"';
$loginresult = mysql_query($loginquery) OR DIE(mysql_error());
while ($login = mysql_fetch_row($loginresult))
{
if ($i_login == $loginї0]) {
if ($i_pw == $loginї1]) {
if ($loginї2] == "admin") {
adminMenu();
}
}
}
if ($i_login == $loginї0]) {
if ($i_pw == $loginї1]) {
if ($loginї2] == "user") {
userMenu();
}
}
}
if ($i_login == $loginї0]) {
if ($i_pw == $loginї1]) {
if ($loginї2] == "patient") {
viewData();
}
}
}
}
}
// catchAction();
verifyUser($i_login, $i_pw);
?>
</body>
</html>Can anyone help?