CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Passing Parameters to next Form

Print topic Send  topic

Author Message
FERAD
Posted: 05/25/2004, 4:56 PM

I need to pass a value from one table to the SQL statement in the next Form.

eg. Form1 is blank with field ID (auto inc).
Submit button is set to Insert a new record.
Return page is passed ID value to next form
Open Form2 with ID as a (form?) parameter.

Your help would be greatly appreciated.
Thanks
peterr


Posts: 5971
Posted: 05/26/2004, 2:06 AM

I believe that this was discussed many times on this forum. Please see:
http://forums.codecharge.com/search.php?s_keyword=Multi...]=5&s_forum[]=6
http://forums.codecharge.com/search.php?s_keyword=last+...]=5&s_forum[]=6
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
unaprogrammer


Posts: 5
Posted: 05/26/2004, 3:27 AM

POST and GET
There are two methods to send data from the form to the corresponding php program on the server: GET and POST.
GET sends data as arguments in the URL. POST sends data as part of the body of the page.

CCS pages that insert records into a database only work using the POST method. If you specify GET,
CCS assumes that the page is just collecting data or just a display page with no database, even if you have specified a connection
. It will not insert rows.

However, you can still send and retrieve data using URL args even though the method is set to POST.
If you wish to pass field values between form cycles this is a good way to do that.

Method for passing parameters between forms.

SENDING PAGE:
Navigate to the record (JOBS in my case) and use the Events tab on the Properties sheet to create custom code
in the After Insert event. Use the plus sign to Add Code. Then insert a line similar to this:

$Redirect = $Redirect."custmrid=".$JOBS->CUSTMRID->GetValue();

$Redirect is the CCS variable for the Return Page. This line adds a parameter to the URL which you can see when you run it.

RECEIVING PAGE:
Navigate to the record (JOBS) and use the Events tab on the properties sheet to create custom code in the Before Show.
Use the plus sign to Add Code. Then insert a line similar to this:

$JOBS->CUSTMRID->SetValue(CCGetParam("custmrid"));

CCGetParam will retrieve a value from a URL argument.

Using this will override any default value for custmrid specified in the Properties sheet so you may have to set the default
value in CCGetParam like this:

$JOBS->CUSTMRID->SetValue(CCGetParam("custmrid","NYCTA"));



View profile  Send private message
peterr


Posts: 5971
Posted: 05/26/2004, 10:17 AM

unaprogrammer,
Thanks for detailed info. Let me just clarify that the POST or GET method has no bearing on this stuation. Whether POST or GET was used, the solution is exactly the same. The After Insert event is used after the page already was submitted (whether GET or POST), executed and basically finished processing.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
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.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


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