I have been working on a script that creates a directory named after the logged in username and then the user will be able to upload to that directory.
I am using the following to try and get the username so that I might insert it into the upload script path.
PHP Code:
<?php
session_start();
include_once("dbc.php");
if(isset($_SESSION['userSession']) && !empty($_SESSION['userSession']))
include_once("dbc.php");
$username = mysql_query("SELECT * FROM users WHERE username =".$_SESSION['userId']);
?>
When I run it I get the following:
Error: The directory (/home2/freefor3/public_html/ rotas/sigs/Resource id #4) doesn't exist
Now I understand why it is printing out "Resource id #4" My question is what can I do to get it to return the username itself?