This topic is locked

Pass Variable in Url

7/9/2007 4:22:13 PM
PHPRunner General questions
C
Christopher author

I have a basic form to add records to the db. When that form is saved, I need one of the field values to be passed to a url.
I have an AfterAdd event redirecting to the new page.
My challenge is incorporating the field value in the url.
Does this go in AfterAdd event as well?
I have tried things like $name = $values['LastName']; and then &name=".$name." in my url string, but that gets me Undefined variable: values. I thought $values was already declared? Do I need to declare it again, and if so where? I feel like I am close but yet so far.

Alexey 7/10/2007

Hi,
use this code in After record added event:

global $avalues;

header("Location: ...?name=".$avalues["LastName"]);

exit();

jwoker 7/12/2007

I have not seen Global $avalues before is this a new variable that was not available before or have I just missed it in the past. Is there some place I can go to get a list of what _session and event variables are available for us to work with on the various pages and events.
Is there a corresponding Global $uvalues available in the after record updated event?
Peter

J
Jane 7/13/2007

Peter,
to select edited values in the After record updated event use global $evalues array:

global $evalues;


You can find some code examples in the PHPRunner help.

Also you can find some global variables in the generated files.