• Welcome to PHPVIBE Forums. Please log in.

[ Video Sharing CMS v4 ] How add fields to the registration form

Started by Rafa,

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

RafaTopic starter

I want to add two new fields in the registration form. I imagined copying and pasting the <input type...> and creating the two new columns in the user table would be enough... but I was wrong. Something is missing.

The fields are there and working (front-end)... I filled the form, got no errors, but the new fields were not sent/stored in the user table.

Can anyone one help me figure this one out?

Thanks
  •  

PHPVibe A.

You also need the actual saving process.

Example:

in com/com_register.php under:

"email"=> _post('email'),


add

"customfield"=> _post('the input field name'),


this will pass the value to lib/functions.user.php

public static function AddUser($userData) {


if(!isset($userData[customfield']) || empty($userData['customfield'])) {$userData['customfield'] = '';}


and then in the actual insert query:

INSERT INTO ".DB_PREFIX."users (name,username,email,
...
...
VALUES ('" . toDb($userData['name']) . "',


INSERT INTO ".DB_PREFIX."users (customfield,name,username,email,
...
...
VALUES ('" . toDb($userData['customfield']) . "','" . toDb($userData['name']) . "',

RafaTopic starter

Thank you Alexander, I'll give that a shot.
I am looking to do the same thing for the video upload form.

What would be the process for that? Would I be editing the same files you mentioned previously?

  •  

PHPVibe A.

No, depending what you use, the file are different.

com/com_add.php is the video upload forms holder and processes the fields as well

Similar topics (7)