moti, I'm sorry for the post above, I should've researched the matter thoroughly, you are right, just passing FPN=1 along to register.asp won't do it, the reason is that the new registration page will not include all data, and some of this data is expected by SQL server which has fields of the NOT NULL type.
So I set on to providing this fields with some default values, the fields in question are all in tblAuthor, and I gave the values that suited my case, should be alright for you, and the user can change them later, but you are free to change them:
.Fields("Show_email") = 0 .Fields("Attach_signature") = 0 .Fields("Time_offset") = "+" .Fields("Time_offset_hours") = 0 .Fields("Date_format") = "dd/mm/yy" .Fields("Rich_editor") = 0 .Fields("Reply_notify") = 0 .Fields("PM_notify") = 0 |
The next challenge was to find the proper place in register.asp to pass these default values, and I found it, it must be a place where only runs when it's a new registration and nothing else, so, open your file, under the (Update datbase) section (yes its mispelled in your file also), slighly under that, look for these lines:
If strMode = "new" Then .Fields("Username") = strUsername If strMode = "new" Then .Fields("Group_ID") = intForumStartingGroup |
Replace those lines with:
'Removed by tSC and replaced below 'If strMode = "new" Then .Fields("Username") = strUsername 'If strMode = "new" Then .Fields("Group_ID") = intForumStartingGroup
If strMode = "new" Then .Fields("Username") = strUsername .Fields("Group_ID") = intForumStartingGroup
'Added by tSC to allow simple reg FPN=1 (intUpdatePartNumber=1) populate not null fields If intUpdatePartNumber = 1 Then .Fields("Show_email") = 0 .Fields("Attach_signature") = 0 .Fields("Time_offset") = "+" .Fields("Time_offset_hours") = 0 .Fields("Date_format") = "dd/mm/yy" .Fields("Rich_editor") = 0 .Fields("Reply_notify") = 0 .Fields("PM_notify") = 0 End If
End If |
Note: this is all under (With rsCommon) and before ('If part number = 0 (all) or part 1) note the (1) not (2).
I always add a ('Added by tSC...) comment, so I always know what I have changed, and I could search files for tSC and get my changes easily, you can change that if you want. Also note, I created a (If intUpdatePartNumber = 1) condition, so the code only runs if you want a simple reg form, when you change registration_rules back to its original state (not passing FPN=1) to get a full reg form, my code won't cause any problems what so ever.
It was all tested, in many different ways.
Hope this could be useful for you, or anyone else trying to implement a simple reg form.