Need help comparing URL query parameter to database value

Hi Wapplers!

I’m trying to create my signup confirmation process and having a hard time with the confirmation email verification.

What I’m wanting to accomplish is:

  1. A new user clicks a link in their email
  2. Once the webpage loads it compares the url parameter to the value in the “confirm_key” field on their user record.
  3. If they match, then it updates the User record’s “Confirmed” field from 0 to 1 and then redirects the user to the homepage.

I am stuck on number 2 above.

The URL that is sent to the user looks like this.
https://mywebsite.com/confirm?confirm_key=b44622294a31071861c1

Hello,
Please check the following tutorial:

It shows pretty similar workflow.

Thanks @Teodor. I started to look at that, but it’s seems fairly complex. Is using a form the only way Server Connect can read the parameter and then perform an update?

No, it’s not the only way. You can run a server action on page load and use a GET variable to compare the value.

So in your server action create your GET var, which will pass the URL param value to the query/condition. Then on the page, bind the url value to the GET parameter in the server connect component properties.

Awesome, that is what I’m trying to do, but I’m having issues with the Condition. Whenever I have a Condition in my Server Action, then no data displays in the Server Connect data section.

image

We are going to check this.

2 Likes