Hello,
This small script is activated when members login. First time creates new folder, otherwise navigates to members folder.
My problem is the DB part is not consist enough in identifying the member login in. So have been trying to use SESSION, but can't get it to work. This is the script with the DB part still in place:
<?php
ob_start();
$Database = mysql_connect("localhost", "vars", "vars");
mysql_select_db("database");
$fields = mysql_query("SELECT * FROM users");
$Username = mysql_result($fields,0,"username");
$dirname = $Username;
$filename = "on/cont/" . "$dirname";
if (file_exists($filename)) {
header ( "Location: " . "$filename" . "$dirname");
} else {
mkdir("on/cont/ " . "$dirname", 0777);
echo "welcome " . "$dirname" . "Your Area Is Being created.";
}
ob_end_flush();
have tried this last but will not work:
<?php
session_start();
if (isset($SESSION['username']))
$user = $SESSION['username'];
else
$user = "";
print ($user);
?>
Print Command purely for test purposes. Finally it should be made clear that login is in dir(a) while this is in dir(d), while directory structure is simply:
a,b,c,d,.
Any help with this is greatly appreciated, as I'm not moving at all, (haven't for two days, really stuck).
DG