Record set has 2 text fields in the form which is set in a full repeat recordset browse. So, we get a long list of every record in the database. However, I want to be able to click on a single record and make another page appear. I can do this if the display is set as a table without using a text field form -- just the record variable and using a hyperlink. But, I want to use the text field. Wrapping the form only gets me the value of the last record displayed. Help would be appreciated.

Sorry about that. Thought that I was being plain. Ok, using PHP, I have a whole list of names each displayed in a text field. A name browser. I want to be able to click on a name and pass the information to the next page -- a detail page. I do not want to use a URL link to pass the information. I want to use $SESSION['sessionvar']. The problem is that it will only load the information from the last record from the browser. Here is the code at present:

Actually it is the primary key that I want to use. The code was just the last one I was trying. I don't want the key seen or able to be captured. I will actually alway be coming from a hidden field. But is so.... necessary to pass to each new page. I need to get it from a click on the name field. Go look at one of my browsers at www.shilohgens.com/sh_files/frmIFListFrame.php.

No, although a good idea, I need to be able to get the info from the selected row of data. This same procedure is to be used in many different pages. I need to find a way for it to work. Is it possible to to do this?

I mean if it will work from a simple text line displayed from the row:

PHP:

?>

Clicking on the "View" for #2, the display is:

Array( [sesDCode] => 3)

See what the problem is? It will only capture the last one displayed not the one selected. I want the selection. Got any more ideas? I am totally dry on this. If it was any other coding C, VB, etc. no problem but this???

Just a thought, if you really want to use sessions to hide the id number, then why not create an array in the session of the id's and use the array key as the id number listed in the form for each item?

Your database may have thousands of records, but if this is a page you would be creating on a regular basis, you shouldn't be pulling them all at once. I wouldn't get them in groups larger than 50 at a time, so you should create a pagination system for it and just flush your session set each page.

For part two, create your session array at the same time that you would create your forms:

That would establish your session array of session id numbers that reveal nothing about the unique record id that you want to keep secret and it would replace it with a fresh array on each page, that way, when you click an item, the session array would know how to identify it. Then, on your page where you need the record id itself:

$recordId = $_SESSION[$_POST['id']];
// do whatever you need to with your record id
// you can still do a dump of the session and see all the key: value pairs
echo "<pre>";
print_r($_SESSION); // display what is stored
echo "</pre>";

This would still work with thousands of records, in theory, but the page would have an incredible load time and bog down your server, regardless of your chosen method.

All of this is unnecessary and overly complicated, there is currently no reason at all to hide the pk from the user. The code I posed, passes the script which receives the post'd values the pk for that row - therefore indicating 'which row was clicked on'.

If you use the session solution posted above, it will break once you use multiple tabs.

All of this is unnecessary and overly complicated, there is currently no reason at all to hide the pk from the user.

I don't know why the poster is so worried about exposing the record id either. I am just trying to give him a solution that he could work with.

If you use the session solution posted above, it will break once you use multiple tabs.

That is true. Every load of a page will blank the session array and reload it with new values. However, if he wants a session solution that bad, then he may have to make some sacrifices along the way or make an adjustment to the array to include a page number as a key above the array.