close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Double Opt-in Registration...Add the string to the database

Thread began 4/09/2014 8:32 am by Nathon Jones Web Design | Last modified 5/06/2014 9:36 am by Jason Byrnes | 3815 views | 24 replies |

Nathon Jones Web Design

Double Opt-in Registration...Add the string to the database

http://www.webassist.com/tutorials/Double-opt-in-registration

Am working through the Double Opt-in tutorial and, because I'm not using the SecurityAssist Wizard to initially create my pages, some questions have arisen.

In the "Add the string to the database section" of the tutorial it references an "Insert Record (users)" server behaviour. We have our own INSERT behaviour which takes the details directly from the registration form.

I've created a hidden form field that uses the Session value "rpw", created in the tutorial, so that we are able to insert it via our INSERT server behaviour however sections 11 and 12 then go on to read:

11.Clear the Go to (optionall) field in the After Insert section.
Clearing this value allows the trigger we set earlier in Universal Email to fire instead of this one.

12.Uncheck the Pass original querystring checkbox.

Will not doing these two steps now cause us problems? I would give it a try but, like our checkout problems (which remain unresolved), I don't want it to all end up in a big heap on the floor after, again, having spent a lot of time genuinely following the instructions and guidance provided in the tutorials.

Thank you for your assistance.
NJ

Sign in to reply to this post

Jason ByrnesWebAssist

it sounds like you are using the Standard Dreamweaver insert record behavior. the tutorial is centered towards using the Data Assist insert record behavior and will not work correctly when using the Dreamweaver insert.


The way the random session works is tat is created each time the page loads, if you store the random session in a form element and use that to save to the database, you will end up with a different value in the database from what is included in the email.


by using theData Assist insert, you will be able to use the session binding in the insert behavior so that the same value will be saved to database as isn sent in the email.


and do follow steps 11 and 12 as written in the tutorial when configuring the insert.

Sign in to reply to this post

Nathon Jones Web Design

In the DataAssist: Insert Single Record behaviour window there is a section asking to "Save inserted ID in Session". Should that be left blank?

Sorry, and the Bindings should use the WA Validated Entries list which is validating my registration form?

Sign in to reply to this post

Jason ByrnesWebAssist

no, it should not be left blank.

The inserted ID will be used in the registration email.

in the tutorial, the inserted ID is saved as a session named:
SecurityAssist_UserID

and is used for the id URL variable in the confirm registration link.

No, do not use the validated entries bindings, these only have a value when the form fails validation. use the Form binding group, it will be named for the form on your page.

Sign in to reply to this post

Nathon Jones Web Design

In the Bindings section, the id field from my user table should be left blank though, right, as it is an auto_increment primary key field in my users table?

I'm concerned about the userupdate.php page which is mentioned in the tutorial as having been created by the SecurityAssist Wizard. Can I build that page myself? As I understand it, this page allows a user to request a new verification link, is that correct?

Much appreciated.
NJ

PS. Sorry, in the Bindings, the UserVerification field in my users table should be binded to the rpw session, is that correct?

Sign in to reply to this post

Jason ByrnesWebAssist

yes, the primary key column should not have a binding.

yes, you can create the update page manually, it;s just like any other update page.

create a recordset that filters the user ID column with the ID session variable created by the login

use that recordset to populate form elements.

add the update record server behavior, use the UserID session as the primary key value to tell what record to update.


no, the random password session is saved to the randomSting column:

  Add the string to the database
Since we have this fancy random string all created, we need to insert it into the database so we know which string is for which user.

Click Window > Server Behaviors to open the Server Behaviors panel, if it isn't open already.
Find the Server Behavior called Insert Record (users).
Double click the Server Behavior to open it.
Click the Bindings Tab.
Click randomString from the Column column.
Next to the Value field, click the lightning bolt.
Expand the Session list in the server entity dialog.
Select rpw.
Click OK.
Click the General Tab.
Clear the Go to (optionall) field in the After Insert section.
Clearing this value allows the trigger we set earlier in Universal Email to fire instead of this one.
Uncheck the Pass original querystring checkbox.
Click OK.
Save the page.  



the user verification filed gets a value of 0 initially, when the link is clicked, it will get updated to 1

Sign in to reply to this post

Nathon Jones Web Design

This post has been deleted.

Nathon Jones Web Design

When we click the link in our verification e-mail we get:

Notice: Undefined variable: totalRows_rsVerify in /home/led2014/public_html/user-confirm.php on line 19
Unknown column 'users.randomString' in 'where clause'

17 <?php
18 @session_start();
19 if(!($totalRows_rsVerify == 0)) {
20 $_SESSION["emailVerified"] = "1";
21 }
22 ?>

Sign in to reply to this post

Nathon Jones Web Design

In the WHERE clause I changed 'users.randomString' to our actual values 'LEDusers.LEDUserVerificationCode' and that has removed that part of the error, however the "Notice: Undefined variable: totalRows_rsVerify in /home/led2014/public_html/user-confirm.php on line 19" remains.

Hope you can help.
Thank you
NJ

Sign in to reply to this post

Jason ByrnesWebAssist

the code to set the session is at lines 17 - 22

the code to create the rsVerify recordset is at lines 57 - 74

since the session variable uses a value in the recordset, the code for the session needs to be after the recordset.

move the code for setting the session to come just after the code for the recordset.

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...