CodeCharge Studio
search Register Login  

Web Reporting

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

YesSoftware Forums -> CodeCharge Studio -> General/Other

 How to send and retrieve HTTP request parameters?

Print topic Send  topic

Author Message
Paolo Valladolid
Posted: 05/17/2004, 4:46 PM

Hi,

I have a page that inserts a new record for a person, then redirects to another page on which the user can enter the address for this new person. What I want to do is pass the first_name and last_name of the person that was just added to the "AddAddress" page.

My problem is I can't get the Record on the AddAdress page to retrieve my first_name and last_name HTTP request parameters. Then again, I am also unsure as to whether those two are being passed in the first place.

I've spent a lot of time searching the documentation/help and I can't find the information I need.
peterr


Posts: 5971
Posted: 05/17/2004, 6:34 PM

Your HTTP request parameters should be shown within the URL. If your second page URL doesn't show any parameters then they don't exist.

Your project however looks almost exactly as our "Multi-Step User Registration" example at http://examples.codecharge.com/ExamplePack/MultiStepReg...gistration1.php
It first asks for the First Name and Last Name, and then on the next page it asks for the Address. Seems exactly what you're doing, except we don't use parameters and do not display the Name on the 2nd page. However if you add First Name and Last Name to the same example then they will be automatically displayed on the 2nd page.

If this is not what you need, for example if you want to create multiple addresses for one person then you may need to use the After Insert event to append the submitted values to the URL as HTTP request parameters, so that they can be retrieved on the next page. You can refer to that same example to see how to do this (user_id is appended to the URL there).
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
PaoloValladolid

Posts: 11
Posted: 05/18/2004, 5:34 AM

Thanks for referring me to this example. Just to make sure I understand you correctly, are you referring specifically to this "after insert" code? If so, it looks it it will satisfy my needs (getting the ID I just created with the insert, then passing it on to the next page with when the user clicks my "Next" button).


If IsEmpty(Request.QueryString("user_id")) Then
LastID = CCDLookup("max(user_id)","users","user_login="&DBInternetDB.ToSQL(Request.Form("user_login"),"CCText"),DBInternetDB)
If InStr(Redirect,"?") = 0 Then
Redirect = Redirect & "?user_id=" & LastID
ElseIf Right(Redirect, 1) = "?" Then
Redirect = Redirect & "user_id=" & LastID
Else
Redirect = Redirect & "&user_id=" & LastID
End If
End IF
View profile  Send private message
PaoloValladolid

Posts: 11
Posted: 05/18/2004, 9:19 AM

Another question:

In the "Multi-Step User Registration" example given, the User's name and address information are all in the same table. In the application I'm working on, the address info is stored on a separate table, which of course also has a user ID column.

I followed the suggestions to use CCDLookup to retrieve the user ID just created, then append it to Redirect. But I cannot get CodeCharge to retrieve the user's last name in Page 2 of my form. I am using the following settings for my Recoird object on the 2nd page:

Data Source Type = SQL
Data Source =

SQL Statement = select * from Address a, User u
where a.userId = u.userId
Parameters = (I'm not sure what to put here - I tried clicking the +, entering "u.userId" for Variable Name, "Integer" for Variable Type, "userId" for Parameter Source and "URL" for parameter type.

This isn't working because Page 2 is pulling up somebody else's address.
View profile  Send private message
PaoloValladolid

Posts: 11
Posted: 05/18/2004, 9:29 AM

Ok, I got something from my User table to appear in my Page2, but that was by setting my Data Source Type to Table and my Data Soure to User instead of Address (the address table).

I bet what's going to happen is my Page 2 will now try to insert into User instead of Address. I need help on this too, of course.

Paolo
View profile  Send private message
PaoloValladolid

Posts: 11
Posted: 05/18/2004, 11:15 AM

The lastest thing I tried:

1. Click the "..." button in Data Source (Data Source Type still set to Table/View)
2. Click Build Query in the Data Source popup dialog
3. Click the Add Tables button in the Visual Query Builder window
4. Select another table so I now have both User and Address in the window
5. Select firstName and lastName from User
6. Select lastName as the Control Source for my Label

Still doesn't work. I don't get this because when I have my Data Source set to just the User table, CodeCharge pulls up the lastName that I entered in my Page1, but when I have the DataSource set to both the User and Address tables, it can't find the lastName anymore.
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.

PHP Reports

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

Home   |    Search   |    Members   |    Register   |    Login


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