Navigate without using sub ids
<p>i am just setting up the general template for my website and the little bit of php that i am doing is to just get the users id from page to page, in other words i want the user while logged in to go from page to page, without using the sub id in the header of user_id=3 for example, and then using the get function to get it and display their information, i want to be able to do it without that.</p>

<p>Here is my code but i keep getting the error </p>

<pre><code>Notice: Undefined index: user_id in C:\xampp\htdocs\Arken\profile.php on line 7
</code></pre>

<p>LOGIN CODE (not all of it of course, just the bit for setting the sessions tuff)</p>

<pre><code>// Create session var for their raw id
                $user_id = $row["user_id"];   
                $_SESSION['user_id'] = $user_id;
                // Create the idx session var
                $_SESSION['idx'] = base64_encode("g4p3h9xfn8sq03hs2234$id");
                // Create session var for their username
                $login_username = $row["login_username"];
                $_SESSION['login_username'] = $login_username;
                // Create session var for their password
                $login_userpass = $row["login_password"];
                $_SESSION['login_userpass'] = $login_userpass;
</code></pre>

<p>PHP for each page</p>

<pre><code>    session_start();

$user_id = "";


if ($_GET['user_id']) {

     $user_id = $_GET['user_id'];

} else if (isset($_SESSION['user_id'])) {

     $user_id = $_SESSION['user_id'];

} else {

   include_once "index.php";
   exit();
}
include 'connect_to_mysql.php';
</code></pre>

<p>Thanks for your help</p>
