Hi All -

I am creating a registration system (for events) and want to send the user a confirmation mail along with a list of the people he registered to attend the event.

In one point of the process they indicate how many people they want to register, I use this number to build a form:

$var = for ( $y=0; $y < $nparticipants; $y++ ) {
	echo "\t ".'<tr>'."\n\t ";
		echo "\t ".'<td><input type="text" name="fname[]" value="'.$fname[$y].'"/></td>'."\n\t ";
		echo "\t ".'<td><input type="text" name="pname[]" value="'.$pname[$y].'"/></td>'."\n\t ";
		echo "\t ".'<td><input type="text" name="mname[]" value="'.$mname[$y].'"/></td>'."\n\t ";
		echo "\t ".'<td><input type="text" name="rut[]" value="'.$rut[$y].'"/></td>'."\n\t ";
		echo "\t ".'<td><input type="text" name="pos[]" value="'.$pos[$y].'"/></td>'."\n\t ";
		echo "\t ".'<td><input type="text" name="fono[]" value="'.$fono[$y].'"/></td>'."\n\t ";
		echo "\t ".'<td><input type="text" name="email[]" value="'.$email[$y].'"/></td>'."\n\t ";
	echo '</tr>'."\n";
}

Where $nparticipants = number of rows to generate.

Now I've got the problem I need to load that information back into a $variable. Specifically I need to load it into a variable that is used to generate the body message of an email ($message).

Eg.

$EmailFrom = 'email_from';
$mailto = 'email_to';
$from_name = 'Sender's Name';
$from_mail = 'Recipient's Name';
$replyto = $EmailFrom;
$uid = md5(uniqid(time()));
$subject = "New Registration ".$eventname;
$message = '
<strong>¡Bienvenido al Proceso de Matrícula para el Curso de ......

Any help would be much appreciated!

Got it!

for ( $y=0; $y < $nparticipants; $y++ ) {
 $foomanshu .= 
  '<tr>
    <td><input type="text" name="fname[]" value="'.$fname[$y].'"/></td>
    <td><input type="text" name="pname[]" value="'.$pname[$y].'"/></td>
    <td><input type="text" name="mname[]" value="'.$mname[$y].'"/></td>
    <td><input type="text" name="rut[]" value="'.$rut[$y].'"/></td>
    <td><input type="text" name="pos[]" value="'.$pos[$y].'"/></td>
    <td><input type="text" name="fono[]" value="'.$fono[$y].'"/></td>
    <td><input type="text" name="email[]" value="'.$email[$y].'"/></td>
   </tr>';
}

We create a concatenated variable and load everything into that variable through each loop. I can then put this into my email.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.