Topic RSS
1:00 pm
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
Most Users Ever Online: 959
Currently Online:
142 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: 3550
Members: 1464
Moderators: 3
Admins: 1
Forum Stats:
Groups: 1
Forums: 4
Topics: 5158
Posts: 18389
Newest Members: juredujmovic, dreamkeeper, rajattyagi, wrokaa, lukass
Moderators: Paul (421), cnymike (8), sonika (95)
Administrators: Oliver (6398)
FAQs
Home
Add Reply
Add Topic
Quote










