03-08-2018, 01:49 AM
For what it is worth, this is how I added some custom fields to the registration page, join.php:
additional_join_form_fields.php
<pre></pre>
during_user_creation.php
<pre></pre>
- Mike
$db->update( $table, $id, $fields_array );
additional_join_form_fields.php
<pre>
Code:
<label for="phone_number">Phone Number*</label>
<input type="text" class="form-control" id="phone_number" name="phone_number" placeholder="Phone Number" value="<?php if (!$form_valid && !empty($_POST)){ echo $phone_number;} ?>" required>
<br>
<label for="most_recent_employer"> Current or Most Recent Employer*</label>
<input type="text" class="form-control" id="most_recent_employer" name="most_recent_employer" placeholder="Most Recent Employer" value="<?php if (!$form_valid && !empty($_POST)){ echo $most_recent_employer;} ?>" required>
<br>
<label for="certifications">List all Relevant Certifications*</label>
<input type="textarea" class="form-control" id="certifications" name="certifications" placeholder="Certifications" value="<?php if (!$form_valid && !empty($_POST)){ echo $certifications;} ?>" required>
during_user_creation.php
<pre>
Code:
// update text fields for last registered user. Uses associative array
$id = $theNewId;
$table = 'users';
$fields_array = [];
$fields_array += ['phone_number'=>Input::get('phone_number')];
$fields_array += ['most_recent_employer'=>Input::get('most_recent_employer')];
$fields_array += ['certifications'=>Input::get('certifications')];
- Mike
$db->update( $table, $id, $fields_array );