This topic is locked

Login Error

2/22/2012 03:29:44
PHPRunner General questions
S
Sergej author

Unknown: Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is enabled. You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn to off, respectively

It shows login page and you may login normally but it displays this error on login page openning. I'm using phprunner 6.0 build 9948

Any hints?

thnx to all of you...

C
cgphp 2/22/2012

Have you set to NULL some global var like $_SESSION['UserId'] ?

S
Sergej author 2/22/2012



Have you set to NULL some global var like $_SESSION['UserId'] ?



No, though i check somewhere if user is logged in
$proba = $_SESSION["id"];

if (empty($proba)) {

echo "No user logged in!";

echo "
";

echo "To see your profile please enter your data in Member Login area!";

return;

this is external php page from where i can go to the login page by clicking link - it works fine if user remained logged from before but if he was logged out and then comes from that external page - the login page appears with this error/warning, but user can log in nevertheless.

Sergey Kornilov admin 2/22/2012

Not sure how we can help if we don't know the code of your external PHP pages. We can only help you setup PHPRunner application itself.

S
Sergej author 2/22/2012



Not sure how we can help if we don't know the code of your external PHP pages. We can only help you setup PHPRunner application itself.


this is the code from the external php page...

<?php ob_start(); ?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">;

<html xmlns="http://www.w3.org/1999/xhtml">;

<head>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

<title>TCI Global</title>

<style type="text/css">
.text {

font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;

font-size: 12px;

margin-right:10px;

line-height: 18px;

}

.textWhite {

font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;

font-size: 12px;

margin-right:10px;

line-height: 18px;

color: #FFF;

}

.newstitle {

font-family: "Myriad Pro";

font-size: 24px;

margin-right:10px;

line-height: 18px;

}

.newsbar {

font-family: Georgia, "Times New Roman", Times, serif;

font-size: 10px;

margin-right:10px;

line-height: 18px;

border-top-width: 1px;

border-right-width: 0px;

border-bottom-width: 1px;

border-left-width: 0px;

border-top-style: solid;

border-bottom-style: solid;

border-top-color: #CCC;

border-right-color: #CCC;

border-bottom-color: #CCC;

border-left-color: #CCC;

width: 100%;

height: 20px;

}

.latestnews {

font-family: Georgia, "Times New Roman", Times, serif;

font-size: 12px;

margin-right:10px;

line-height: 14px;

font-style: italic;

color: #999;

}

.newsText {

font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;

font-size: 10px;

margin-right:10px;

line-height: 12px;

}
.naslov {

font-family: "Myriad Pro";

font-size: 24px;

color:#f26721;

}

velike_fotke {

margin:0px 0px 50px 0px; padding:0px;

position:relative;

top:10px;

width:963px;

}

</style>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">

<?php

include("include/dbcommon2.php");
?>

<table width="100%" border="0">

<tr>
<td align="center"><p>

<map name="Map2Map" id="Map2Map">

<area shape="circle" coords="272,128,3" href="#" />

</map>

<img src="images/menu.jpg" width="963" height="169" border="0" usemap="#Map" />

<map name="Map" id="Map">

<area shape="rect" coords="17,122,55,139" href="index.php" />

<area shape="rect" coords="65,122,100,139" href="why.html" />

<area shape="rect" coords="108,122,157,141" href="#" />

<area shape="rect" coords="165,121,205,140" href="#" />

<area shape="rect" coords="209,123,250,140" href="#" />

<area shape="rect" coords="257,122,296,140" href="#" />

<area shape="rect" coords="305,123,392,140" href="login.php" />

<area shape="rect" coords="813,123,947,141" href="#" />

</map>

</p>

<p><div id="velike_fotke">
<table width="963" border="0">

<tr>

<td width="300" height="350" align="center" valign="top"><table width="280" border="0" align="center" cellpadding="0" cellspacing="0">

<tr>

<td width="280" class="naslov"><br />

<?php echo $_SESSION["first name"]?> <?php echo $_SESSION["last name"]?></td>

</tr>

<tr>

<td width="280" align="center" bordercolor="#000000">

<?php

$proba = $_SESSION["id"];

if (empty($proba)) {

echo "No user logged in!";

echo "
";

echo "To see your profile please log in by clicking Member Login area tab!";

return;

}

$sql = "SELECT picture, UserID FROM Individual_profiles WHERE UserID= '".$_SESSION["id"]."' ";

$rs = CustomQuery($sql);

$data = db_fetch_array($rs);
if ((empty($data["picture"]))) {

$sql = "SELECT picture, UserID FROM Individual_profiles WHERE UserID= '0' ";

$rs = CustomQuery($sql);

$data = db_fetch_array($rs);

echo "<img src=\"imager.php?table=Individual_profiles&field=picture&key1=".$data["UserID"]."\">";

echo "
";

echo "No photo available, stock photo used!";

}

else

{

$sql = "SELECT picture, UserID FROM Individual_profiles WHERE UserID= '".$_SESSION["id"]."' ";

$rs = CustomQuery($sql);

$data = db_fetch_array($rs);

echo "<img src=\"imager.php?table=Individual_profiles&field=picture&key1=".$data["UserID"]."\">";

}

echo "
";

$sql = "SELECT picture, UserID FROM Individual_profiles WHERE UserID= '".$_SESSION["id"]."' ";

$rs = CustomQuery($sql);

$data = db_fetch_array($rs);

echo $data["UserID"];
?></td>

</tr>

<tr>

<td width="280"><span class="text"><br />

Item 1</span></td>

</tr>

<tr>

<td width="280"><span class="text">Item 2</span></td>

</tr>

<tr>

<td width="280"><span class="text">Item 3</span></td>

</tr>

</table></td>

<td width="663" align="left" valign="top"><p class="latestnews">&nbsp;</p>

<p class="latestnews">Profile Information</p>

<table width="600" border="0" cellpadding="0" cellspacing="2">

<tr>

<td width="190" align="right" valign="top"><span class="text">About me:</span></td>

<td width="411" align="left" valign="top" bgcolor="#CCCCCC"><p class="textWhite">

<?php

$sql = "SELECT aboutme FROM Individual_profiles WHERE UserID= '".$_SESSION["id"]."' ";

$rs = CustomQuery($sql);

$data = db_fetch_array($rs);

echo $data["aboutme"];

?>

</p></td>

</tr>

<tr>

<td align="right" valign="top"><span class="text">Skills:</span></td>

<td width="411" align="left" valign="top" bgcolor="#CCCCCC"><p><span class="textWhite">

<?php

$sql = "SELECT skills FROM Individual_profiles WHERE UserID= '".$_SESSION["id"]."' ";

$rs = CustomQuery($sql);

$data = db_fetch_array($rs);

echo $data["skills"];

?>

</span></p></td>

</tr>

<tr>

<td align="right" valign="top"><span class="text">Working experience(Years):</span></td>

<td width="411" align="left" valign="top" bgcolor="#CCCCCC"><p><span class="textWhite">

<?php

$sql = "SELECT Workingexperience_Years FROM Individual_profiles WHERE UserID= '".$_SESSION["id"]."' ";

$rs = CustomQuery($sql);

$data = db_fetch_array($rs);

echo $data["Workingexperience_Years"];

?>

</span></p></td>

</tr>

<tr>

<td align="right" valign="top"><span class="text">e-mail:</span></td>

<td width="411" align="left" valign="top" bgcolor="#CCCCCC"><p> <?php

$sql = "SELECT email FROM TCIUsers WHERE id= '".$_SESSION["id"]."' ";

$rs = CustomQuery($sql);

$data = db_fetch_array($rs);

echo "<a href=\"mailto:".$data["email"]."\">".$data["email"]."</a>";

?></p></td>

</tr>

<tr>

<td align="right" valign="top"><span class="text">Other:</span></td>

<td width="411" align="left" valign="top" bgcolor="#CCCCCC"><p><span class="textWhite">lorem ipsum lorem ipsum</span><span class="textWhite">lorem ipsum lorem ipsum</span><span class="textWhite">lorem ipsum lorem ipsum</span><span class="textWhite">lorem ipsum lorem ipsum</span><span class="textWhite">lorem ipsum lorem ipsum</span><span class="textWhite">lorem ipsum lorem ipsum</span><span class="textWhite">lorem ipsum lorem ipsum</span><span class="textWhite">lorem ipsum lorem ipsum</span><span class="textWhite">lorem ipsum lorem ipsum</span><span class="textWhite">lorem ipsum lorem ipsum</span></p></td>

</tr>

</table>

<p class="newstitle">&nbsp;</p></td>

</tr>

<tr>

<td>&nbsp;</td>

<td>&nbsp;</td>

</tr>

</table>

</div></p>
<p>&nbsp;</p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p>&nbsp;</p></td>

</tr>

</table>
</body>

</html>

<?php ob_flush(); ?>
and on a login page after succesful login:

i have this:

$_SESSION["username"] = $data["username"];

$_SESSION["firm"] = $data["firm"];

$_SESSION["TCIUserID"] = $data["TCIUserID"];

$_SESSION["first name"] = $data["first name"];

$_SESSION["last name"] = $data["last name"];

$_SESSION["country"] = $data["country"];

$_SESSION["id"] = $data["id"]

Sergey Kornilov admin 2/22/2012

Sergej,
thank you.
What I'm saying that this is the code that is not written by us running on some web server with unknown configuration. All we can do is to Google the error message ("Unknown: Your script possibly relies on a session side-effect which existed until PHP 4.2.3") hoping it provides some good advice.
Probably this link can help:

http://www.webmasterworld.com/php/3861516.htm