DMXzone App Connect Support Product Page

Answered

How do I insert URL parameter in database on submit?

Asked 25 Apr 2018 03:39:52
1
has this question
25 Apr 2018 03:39:52 Lee Reynolds posted:
For example, I have the URL page.php?id=1 - I've set a Global $_GET to #id (numeric), then set the column value to {{$_GET.id}}. The $_POST values get added, but the $_GET value isn't populating on insert submit. I think at one point some of the older tools used {{$URL.id}} and I've tried that as well. What am I missing?

Replies

Replied 25 Apr 2018 10:21:04
25 Apr 2018 10:21:04 Teodor Kuduschiev replied:
Hello Lee,
You cannot send GET variables when using POST method to submit data.
My suggestion is - remove this GET var from server connect, and create the same one under POST. Use this POST variable in the insert value.
Then on the page, define a query parameter in app connect panel: prntscr.com/j9vmf3
Create a hidden field in your form using the same name/id as the POST variable in server connect and assign the query.id as its value: prntscr.com/j9vnl5
This way you can send the url parameter value, with your post variables.
Replied 25 Apr 2018 12:50:35
25 Apr 2018 12:50:35 Lee Reynolds replied:
Wow - that worked!

So I understand the tool better - when defining a query parameter in app connect panel (your screenshot - prntscr.com/j9vmf3) - how does it know it's looking for a URL value and not some other value (like a Session var)? I don't see where you tell the system that the ID var is from the URL.
Replied 25 Apr 2018 12:53:32
25 Apr 2018 12:53:32 Teodor Kuduschiev replied:
Yes, the query parameters are expecting an URL variable (query string).
Under define query you define the query strings (URL variables) which you are using and need for the action(s) on the page.
Replied 25 Apr 2018 13:45:07
25 Apr 2018 13:45:07 Lee Reynolds replied:
OK, makes sense. If this is the method, what would ever get stored under Globals > $GET? My mistake was thinking this is where you'd tell the system there's a URL var (old Dreamweaver thinking).
Replied 25 Apr 2018 13:48:10
25 Apr 2018 13:48:10 Teodor Kuduschiev replied:
When posting data via form, you always use POST.
GET is used when the server action runs without a form, and needs some additional data.

Reply to this topic