This topic is locked

How to pass values

11/7/2017 11:15:06 AM
PHPRunner General questions
R
Ron38 author

I have a veteran's database that I want to convert to the web. I know very little about PhP, altho I have been programming other languages for 60 years...

I want to display a list of clients, based on a View that I have created: when the user selects one record in the view, I want to save two values, and use those in other forms to access single records. I can create the form with the list of records, but what do I do then?

S
Scrolin 11/7/2017



I have a veteran's database that I want to convert to the web. I know very little about PhP, altho I have been programming other languages for 60 years...

I want to display a list of clients, based on a View that I have created: when the user selects one record in the view, I want to save two values, and use those in other forms to access single records. I can create the form with the list of records, but what do I do then?


I'm very far from an 'advanced member' let alone an expert but this seems pretty close to what I was trying to achieve in this topic:[SOLVED] Populate "Add on the fly" screen from current record. It may not be exactly the same as your case but it should give you food for thought.

R
Ron38 author 11/11/2017

I can see that I have mis-phrased my need, I will have a List page showing all of our clients. I wish to take the two primary keys of the row selected and populate a single client page using those keys. So it is a matter of saving two fields and using those as keys for the subsequent page.

Appreciate your responses and apologize for lack of specificity.

Ron

jadachDevClub member 11/11/2017



I can see that I have mis-phrased my need, I will have a List page showing all of our clients. I wish to take the two primary keys of the row selected and populate a single client page using those keys. So it is a matter of saving two fields and using those as keys for the subsequent page.

Appreciate your responses and apologize for lack of specificity.

Ron


Try saving into a session variable, then use the session on subsequent pages.

romaldus 11/11/2017
  1. In visual editor, insert a button anywhere you want in list page
  2. Double click that button, delete all sample codes in "client before" tab
  3. In "server" tab use the following code to get values from selected record


global $dal;

while ( $data = $button->getNextSelectedRecord() )

{

//save data from certain field to session variable

$_SESSION["MySession"] = $data["my_field_name"];

}


4. In "Client After" tab, use the followibg code to redirect to another page :

location.href = 'anypage_add.php';


5. Now in "anypage_add php" you can use [size="2"]$_SESSION["MySession"]as default value in any [/size]field

R
Ron38 author 11/12/2017

Thank you. That will help enormously!