PortalParts.com Site

 Forum Index > Geeklog > General Geeklog New Topic Post Reply
 Add new field in new user register
 |  Printable Version
koalasoft
 March 05 2009 19:03 PM (Read 1529 times)  
Forum Full Poster
Full Poster

Status: offline

Registered: 06/01/05
Posts: 10

Hi to all !!

I want to add a field but in the user registry, and who similarly is in the data base kept.

. - The complete registry for the user Activates.
. - In the data base agrege the Item " carrera" within the table gl_users.
. - Within memberdetail.thtml I added a field but…. .

PHP Formatted Code
<td align="right" class="alignleft" style="vertical-align:middle;padding-left:10px;"><b>{FULLNAME}</b><br{xhtml}><small style="color:#676767">{FULLNAME_HELP}</small></td>
            <td align="left" valign="middle"><input type="text" name="fullname" size="32" maxlength="80" value="{fullname}"{xhtml}></td>
        </tr>


<!-- THIS IS MY NEW FIELD -->
         <tr>
                <td align="right" class="alignleft" style="vertical-align:middle;padding-left:10px;"><strong>{CARRERA}</strong><br{xhtml}><small style="color:#676767">{CARRERA_HELP}</small></td>
        <td>
    <select name="carrera" size="1" onchange="fnc(this)>
      <option value="
Elegir" selected="selected">
      <option value="
ING. SISTEMAS COMPUTACIONALES">ING. SISTEMAS COMPUTACIONALES</option>
      <option value="
ING. INDUSTRIAL">ING. INDUSTRIAL</option>
      <option value="
ING. BIOQUIMICA">ING. BIOQUIMICA</option>
      <option value="
ING. ELECTROMECANICA">ING. ELECTROMECANICA</option>
      <option value="
ING. CIVIL">ING. CIVIL</option>
      <option value="
LIC. ADMINISTRACION">LIC. ADMINISTRACION</option>
      <option value="
DOCENTE">DOCENTE</option>
      <option value="
PERSONAL DEL I.T.S.R.">PERSONAL DEL I.T.S.R.</option>
      <option value="
EGRESADO">EGRESADO</option>
    </select>
        </td>
         </tr>
 

. - Within lib-custom.php I added in the CUSTOM_userCreate function this…
PHP Formatted Code
/* ===== Carreras ====  */
        $carrera = '';
    if (isset ($_POST['carrera'])) {
        // COM_applyFilter would strip special characters, e.g. quotes, so
        // we only strip HTML
        $carrera = strip_tags ($_POST['carrera']);
        $carrera = addslashes ($carrera);
    }
        /* ===================  */
    DB_query("UPDATE {$_TABLES['users']} SET email = '$email', homepage = '$homepage', fullname = '$fullname', carrera = '$carrera' WHERE uid = $uid");

    return true;

. - and Within the CUSTOM_userForm function the following thing:
PHP Formatted Code
$user_templates->set_var('FULLNAME', $LANG04[3]);
    $user_templates->set_var('FULLNAME_HELP', $LANG04[34]);
    $fullname = '';
    if (isset ($_POST['fullname'])) {
        $fullname = strip_tags ($_POST['fullname']);
    }
    $user_templates->set_var('fullname', $fullname);
       
        // --------------------------------------------
        //                   Carrera
        // --------------------------------------------
        $user_templates->set_var('CARRERA', $LANG04[161]);
    $user_templates->set_var('CARRERA_HELP', $LANG04[162]);
    $fullname = '';
    if (isset ($_POST['carrera'])) {
        $fullname = strip_tags ($_POST['carrera']);
    }
    $user_templates->set_var('carrera', $carrera);

    // ---------------------------------------------

Now, when attempt to make a registry new of user keeps all the data to me but NOT the one that new that I put, in my case the item " carrera" .

How I needs to me so that it can keep that new field in my data base?

Grettings !! :mrgreen:


 
Profile Email Website PM
Quote
Content generated in: 0.21 seconds
New Topic Post Reply



 All times are CDT. The time is now 05:23 AM.
Normal Topic Normal Topic
Locked Topic Locked Topic
Sticky Topic Sticky Topic
New Post New Post
Sticky Topic W/ New Post Sticky Topic W/ New Post
Locked Topic W/ New Post Locked Topic W/ New Post
View Anonymous Posts 
Anonymous users can post 
Filtered HTML Allowed 
Censored Content