CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 (RESOLVED) dynamic returnpage based on search values

Print topic Send  topic

Author Message
expo101

Posts: 24
Posted: 05/21/2011, 3:40 AM

In my CCS project I have a searchpage where the returnpage is specified under the Button_DoSearch properties. Based on one of the search values (a date value), I want the return page to be dynamic. When a date is specified the return page is 'return_1.ccp' and when no date is specified the returnpage should be 'return_2.ccp'.
I'm not an PHP expert, that's why I use CCS, but I'm sure this can be done with some PHP coding. Someone who can help me with this?

Frans de Jong

View profile  Send private message
datadoit
Posted: 05/21/2011, 6:50 AM

Select the Search button, then in the Properties toolbox, choose the
Events tab. For the Server -> On Click, add Declare Variable.

Name: Redirect
Type:
Initial Value: (!$Container->TheDate->GetValue() ) ? "return_2.php" : ""

We're dynamically setting the value for the CodeCharge Redirect variable
using a PHP ternary operator.

(if this) ? then set the value to this : otherwise set it to that

expo101

Posts: 24
Posted: 05/21/2011, 1:56 PM

Thanks Datadoit for your clear explanation. I now arrive at the desired page but the search values/parameters do not come with it so the pages do not show the correct search result. Do I have to put the search values in this string as well?

Thanks for your help.

Frans de Jong
View profile  Send private message
datadoit
Posted: 05/21/2011, 2:28 PM

Then you'll need to build the redirect string to include the search
parameters.

(!$Container->TheDate->GetValue() ) ? "return_2.php?s_Field1=" .
CCGetFromPost("s_Field1", "") . "&s_Field2=" . CCGetFromPost("s_Field2")
: ""
expo101

Posts: 24
Posted: 05/22/2011, 5:49 AM

Hello Datadoit,

Got it to work!! Thanks very much for your help.

Frans de Jong
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.