Jump to content

Recommended Posts

Hi..

I am really new to PHP/MySQL. Could any one of you help me with registering 100 users with their email addresses, passwords and phone numbers from a single admin page. and then the mailer should sent out mails to each of these users notifying them about the account creation.

 

Thanks!

Link to comment
https://forums.phpfreaks.com/topic/40977-mass-user-registration-by-admin/
Share on other sites

I would start by getting all data into an array so you can loop through and do what you want. i.e.

 


$data['email'][]=
$data['password'][]=
$data['phone'][]=

 

Person 1's data is

 


$data['email'][0]
$data['password'][0]
$data['phone'][0]

 

Person 2 would be

 


$data['email'][1]
$data['password'][1]
$data['phone'][1]

 

This will allow you to address each one inside a while loop.

 

<?php
$x=0;

while( $x < $total_results ){ 

$email = $data['email'][$x];
$password = $data['password'][$x];
$phone = $data['phone'][$x];


$query="INSERT INTO users (email,password,phone) values ($email, $password, $phone)";
$result=mysql_query($query);

// mail code here
//mail code here
//mail code here
//mail code here

$x++;
}

?>

 

Rough draft and crude, but its a start.

 

Hope it helps

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.