Gossamer Forum
Home : Products : DBMan : Customization :

Adding record at signup

Quote Reply
Adding record at signup
I added the mod limitrecords1 to my project and now when the user signs up he has the ability to add the record along with selecting a password. However, the create account form does not include the ability to create a Userid . The User Id has to be incorporated into the record form which I do not want. I want the Userid to be within the create account portion along with the Password they choose so that when they wish to modify the record they do not have the ability to alter this...

Does anyone know how I can make to add the Userid to the create account form? I can't understand why it is not added now.

Hope this makes sense...:)



Cher
Quote Reply
Re: Adding record at signup In reply to
Hello Cher, can you save your html.pl file as a text file and make it available to view via the web? Post the URL where the file can be viewed. It's hard to know what's going on in your file without viewing it.

~ Karen

Quote Reply
Re: Adding record at signup In reply to
Sure...I tried to save it in a post but I think the code must have been too large cuz it didn't take :(

The files are at:

http://www.citysingles.net/test/htmlpl.txt
http://www.citysingles.net/test/defaultcfg.txt
http://www.citysingles.net/test/dbcgi.txt

THANKS SO MUCH!!!!

Cher
Quote Reply
Re: Adding record at signup In reply to
Hello Cher ... make a back-up of your file before making changes Wink

In your html.pl file, change the sequencing of things somewhat and change your Userid field from a hidden to an input field and see if that works for you.
(in sub html_record_form )

CHANGE THIS:
print qq|

|;
if ($in{'signup_form'}) {
print qq|
<tr><td width="100" bgcolor="#FFCC00"><font face="Verdana, Arial, Helvetica, sans-serif" size="1" color="#000000"><b>Password:</b></FONT></td>
<td width="385" bgcolor="#FFFF99"><input type="PASSWORD" name="pw" value="$in{'pw'}"></td></tr>
|;
}
print qq|

<input type="hidden" name="ID" value="$rec{'ID'}">
<input type="hidden" name="Userid" value="$rec{'Userid'}">
<input type="hidden" name="Date" value="$rec{'Date'}">
<font face="Verdana, Arial, Helvetica, sans-serif" size="1" color="#000000"><b>

</b></font>
<table width="485" border="0" cellspacing="0" cellpadding="0">


TO THIS:
print qq|
<input type="hidden" name="ID" value="$rec{'ID'}">
<input type="hidden" name="Date" value="$rec{'Date'}">
<table width="485" border="0" cellspacing="0" cellpadding="0">
|;
if ($in{'signup_form'}) {
print qq|
<tr><td width="100" bgcolor="#FFCC00"><font face="Verdana, Arial, Helvetica, sans-serif" size="1" color="#000000"><b>Password:</b></FONT></td>
<td width="385" bgcolor="#FFFF99"><input type="PASSWORD" name="pw" value="$in{'pw'}"></td></tr>
|;
}

print qq|
<tr><td width="100" bgcolor="#FFCC00"><font face="Verdana, Arial, Helvetica, sans-serif" size="1" color="#000000"><b>User ID:</b></FONT></td>
<td width="385" bgcolor="#FFFF99"><input type="text" name="Userid" value="$rec{'Userid'}"></td></tr>

Quote Reply
Re: Adding record at signup In reply to
I replaced the section you told me to but I am still getting this error:

Invalid userid: . Must only contain only letters and be less than 12 and greater than 3 characters.

Does this mean something is configured wrong in either the cfg or cgi file? I can't imagine that it would be the form as it seems like any typical data field....



Cher
Quote Reply
Re: Adding record at signup In reply to
In Reply To:
I replaced the section you told me to but I am still getting this error:
Okay, from the earlier post I thought you were not getting a Userid written to the file ... now I see that you were getting an error message. Smile In looking at the mod, it calls for a field named 'userid', your config file and the html.pl file are using 'Userid' ... the fields are case sensitive, you need to change your config file from Userid to userid and also make that change in the html snippets we were manipulating above. While in the conf file, you may want to change it from:

Userid => [35, 'alpha', -2, 15, 0, '', ''],

to:
userid => [35, 'alpha', 3, 15, 1, '', ''],

to clarify the field size limit and also make entering a userid required.


Quote Reply
Re: Adding record at signup In reply to
Works great!!!! You're an angel!!!!

Only one little problem though and that is when I try to go in and modify the ad it gives the option of modifying the userid too. Is there an else/if statement that I could use that would prevent the option of editing the userid?

Cher
Quote Reply
Re: Adding record at signup In reply to
Cher, give this a try ... where you have the TR for the userid field, replace those lines with the following snippet.

THIS CODE
<tr><td width="100" bgcolor="#FFCC00"><font face="Verdana, Arial, Helvetica, sans-serif" size="1" color="#000000"><b>User ID:</b></FONT></td>
<td width="385" bgcolor="#FFFF99"><input type="text" name="userid" value="$rec{'userid'}"></td></tr>

WOULD BECOME THIS:

|;
if ($in{'add_form'}) {
print qq|
<tr><td width="100" bgcolor="#FFCC00"><font face="Verdana, Arial, Helvetica, sans-serif" size="1" color="#000000"><b>User ID:</b></FONT></td>
<td width="385" bgcolor="#FFFF99"><input type="text" name="userid" value="$rec{'userid'}"></td></tr>
|;
}
else {
print qq|
<tr><td width="100" bgcolor="#FFCC00"><font face="Verdana, Arial, Helvetica, sans-serif" size="1" color="#000000"><b>User ID:</b></FONT></td>
<td width="385" bgcolor="#FFFF99"><font face="Verdana, Arial, Helvetica, sans-serif" size="1" color="#000000">$rec{'userid'}"></font></td></tr>
|;
}
print qq|


<fingers crossed> Smile