PDA

View Full Version : Adding user profile field


DjSao
03-21-2001, 02:55 PM
Ok this is what im doing, im adding a new profile field for Civil Status. And it is going to be a drop down menu, where people can chose from a number of choices. Here is how it looks

<select name="civil">
<option>Choose</option>
<option value="Singel">Singel</option>
<option value="Married">Married</option>
<option value="Other">Other</option>
</select>

Then in the mysql ive added a civil row inthe user table, its a varchar 100.

And ive also created a new template, civil, here is how it looks.

$userinfo[civil]

When i tried adding this new field to the register.php i just copied the codes for icq and changed them to civil, it worked.
But when i tried doing the same thing for member.php it didnt work, the value isnt being submitted to the database. I dont know what im doing wrong.

So could someone who has done this on their own board tell me how they did, or tell me what im doing wrong.

03-21-2001, 03:21 PM
You have to add the new field to all the queries in member.php.

Or you could upgrade to 2.0 and add your own custom fields from within the control panel.

03-21-2001, 03:29 PM
I have 2.0, but it only creates usuall fields, not drop down menus, that is what i want.

I've added this in member.php, all i did was copy quires for icq and changed them to civil

1.

$civil=intval($civil);
if ($civil==0) {
$civil="";
}

2.

civil='".addslashes(htmlspecialchars($civil))."'

3.
if ($userinfo[civil]!="") {
eval("\$userinfo[civil] = \"".gettemplate("civil")."\";");
} else {
$userinfo[civil]="&nbsp;";
}