This topic is locked
[SOLVED]

 Pass parameters

7/29/2010 11:50:16 AM
PHPRunner General questions
I
indigo author

Hi,
I have a Registration Form (register.php) and another table add form (event_add.php)
I want to pass the value using URL on both the forms.
For Registration:

====================

Field = City

Value = "New York"
So, if a user clicks on the URL - www.abc.com/phpproject/register.php?City="New York"

Can it fill the field with that data automatically?
For Event:

====================

Field = confirm

Value = "Yes"
So, if a user clicks on the URL - www.abc.com/phpproject/event_add.php?confirm="Yes";

Can it fill the field with that data automatically?
I tried the method from elsewhere on this forum (Fieldname=value) and it doesn't seem to work.

Please help.

A
ann 8/2/2010

Hi,
use Before display event on the Events tab.

Here is a sample code:

if ($_REQUEST["City"]=='New York'){

$xt->assign("FieldName_value",111)

}



where FieldName is your actual field name.

I
indigo author 8/2/2010

Thanks Ann,
This works great.

But, the idea was to use the values from the URL, so it can insert values even if they are not known in advance.

For example,
If there is a referral field and the value depends on the URL clicked...
so,

www.abc.com/phpproject/event_add.php?referral=xxx

www.abc.com/phpproject/event_add.php?referral=yyy'>www.abc.com/phpproject/event_add.php?referral=yyy

www.abc.com/phpproject/event_add.php?referral=yyy'>www.abc.com/phpproject/event_add.php?referral=yyy
Will require that I have an event with all the possible values already as part of the "Before process" event code.

Can there be a code which will take care of any possible values and also all the fields?

Then we can use it as a generic code for all pages as well.
Thanks for your help.

A
ann 8/3/2010

Hi,
here is a sample code (Before display event on the Events tab):

if ($_REQUEST["City"]!=""){

$xt->assign("FieldName_value",$_REQUEST["City"])

}
I
indigo author 8/3/2010

Thanks. That works. I think I'll just use all the possible fields and put this code. May thanks for your help.