OK, here is the problem,
I do not want to pass a session ID from one page to another. My problem is that i have a page that displays people who have just entered their details in my database. I view these newcomers and then i have a link that when clicked directs you to a navigation page for that specific user whose ID has been clicked. So while in that navigation page the user gets to choose between specific parts that however only correspond to him personally and his own unique entries and nobody else's.When i was not using sessions i was implementing this very simply by simply writing the following in the linker
echo "<td><a href=\"navigation.php?SID=".$SID."\">Process application</a></td>";
Now, however i need to implement sessions to make my hole application more secure and flexible for authentication.
Snippets of code for the page that has the new entries is the following:
//this is how it starts
<?php
session_start();
//then this is how it gets the ID from inside the database assigned in the session variable
while($row=mysql_fetch_array($result)){//the same as mysql_fetch_row but i can use $row[fieldname] now instead of numbers
$_SESSION['sid'] = $row["SID"];
//prints all the actual records inside table row by row in one row
printf("<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>",
$row["SID"],$row["title"],$row["firstname"],$row["surname"],$row["date_created"]);
echo '<td><a href="navigation.php">Process application</a></td>';
THE snippet of CODE For the next page that supposedly should be grabbing this ID for further use is:
<?php
session_start();
include("./includes/functions.inc");
display_header();
printf(£sid);
echo'<a href="./parts/p01.php">PART 1-PERSONAL DETAILS</a>';
echo'<br>';
The problem i have now is that for some reason whatever entry ID i click on it directs me to the parts specified for the user who lastly entered his details in the dbase.
I wonder if it makes sense to any of you guys cause i m very frustrated with this session ideas
Thanks