Hi I'm still fairly new at php. And new to these forums. So HI... lol...
But on to my question/problem. See I have a very very simple language file that I want included in a page like so...
if (isset($_SESSION['user']))
{
$user=$_SESSION['user'];
$userstats="SELECT * from ch_users where username='$user'";
$userstats2=mysql_query($userstats) or die("Could not get user stats");
$userstats3=mysql_fetch_array($userstats2);
$getnewpms="SELECT COUNT(*) from ch_pms where receiver='$userstats3[ID]' and hasread='0'";
$getnewpms2=mysql_query($getnewpms) or die("Could not get new PMs");
$getnewpms3=mysql_result($getnewpms2,0);
echo"<link rel='stylesheet' href='layouts/$userstats3[layout].css' type='text/css'>";
include "language/$userstats3[language].php";
}
else
{
echo"<link rel='stylesheet' href='layouts/default.css' type='text/css'>";
$s=$_SERVER["REMOTE_ADDR"];
$checkip="SELECT * from ch_recordips where ip='$s'";
$checkip2=mysql_query($checkip) or die(mysql_error());
$checkip3=mysql_num_rows($checkip2);
include "language/$checkip3[language].php"; <<<<~~~Problem line...
}
Now see when the user is logged in the file name reads just fine from the and works out great. But the problem is when the user isn't logged in that it doesn't read the file name from an ip stored.
When I tried to load the page with this code it will tell me that there is no such file or directory, which there is a file and directory. And The file name is stored in the database as well. Its doesn't seem to be reading the database, so that must mean its not reading the ip address or something where I check the database for the file...
So thats my problem. If its to confusing or you need more information please let me know and I'll do what I can to fill you in. Thanks in advance.