cforms II User Forum

Registration is currently disabled.
Guest

FAQs

Lost password?
Advanced Search:

— Forum Scope —



— Match —



— Forum Options —




Wildcard usage:
*  matches any number of characters    %  matches exactly one character

Minimum search word length is 4 characters - maximum search word length is 84 characters

Topic RSS
stop submission
February 8, 2013
1:00 pm
Marco
Guest

Hi,

i have a user registration form.

The form must register new users and create the wordpress and create their wordpress account on my site.

To do this I modified the file my-function.php.

Specifically I changed the \"my_cforms_action ()\" :

function my_cforms_action($cformsdata) {

### Extract Data
### Note: $formID = '' (empty) for the first form!

$formID = $cformsdata['id'];
$form = $cformsdata['data'];

### triggers on your third form
if ( $formID == '3' ) {

### Do something with the data or not, up to you
//$form['Your Name'] = 'Mr./Mrs. '.$form['Your Name'];
// ottengo il nome
$username=$form['Username'];
// ottengo la password
$password=$form['Password'];
//ottengo la mail
$mail=$form['Email'];
//ottengo il nome
$nome=$form['Nome'];
// ottengo il cognome
$cognome=$form['Cognome'];

$userdata=array(
'user_pass' => $password,
'user_login' => $username,
'user_email' => $mail,
'first_name' => $nome,
'last_name' => $cognome
);

// creo l'utente wordpress
$result=wp_insert_user( $userdata );

// controllo se c'è un errore nella creazione
if ( is_wp_error($result) )
return $result->get_error_message();

}

The problem is that if the wordpress account already exists, no error is generated as i want..

And consequently are also generated e-mails for the user and administrator.

Any solution?

Thanks a lot.

 

Marco

Forum Timezone: Europe/Berlin

Most Users Ever Online: 959

Currently Online:
28 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

tracedef: 43

mores: 21

Gyrus: 20

frozenwaste: 18

asuffredini: 15

photoworks: 14

Member Stats:

Guest Posters: 3712

Members: 1463

Moderators: 3

Admins: 2

Forum Stats:

Groups: 1

Forums: 4

Topics: 5310

Posts: 18671

Newest Members: juredujmovic, dreamkeeper, rajattyagi, wrokaa, lukass

Moderators: Paul (421), cnymike (8), sonika (95)

Administrators: Oliver (6400), Nicky (3)