redskin Posted January 13, 2009 Report Share Posted January 13, 2009 <?php//Database connectionrequire "db.php";// Data Formif (isset($_POST["naam"])) $name = $_POST["name"];if (isset($_POST["address"])) $address = $_POST["address"];if (isset($_POST["zip"])) $zip = $_POST["zip"];if (isset($_POST["city"])) $city = $_POST["city"];if (isset($_POST["phone"])) $phone = $_POST["phone"];if (isset($_POST["email"])) $email = $_POST["email"];foreach($_POST['kidname'] as $row => $value1){$kidname = mysql_real_escape_string($value1);$age = mysql_real_escape_string($_POST['age'][$row]);$lesson = mysql_real_escape_string($_POST['lesson'][$row]);$kiddata = $kidname . " - " . $age . " - " . $lesson;//echo $name.$address.$zip.$city.$phone.$email.$kiddata.$sql = "INSERT INTO aanmelding VALUES (NULL, '$name', '$address', '$zip', '$city', '$phone', '$email', '$kiddata')";$res = mysql_query($sql);if ($res){}$ord = mysql_query("SELECT aanmldid FROM aanmelding ORDER BY aanmldid DESC LIMIT 1");$row = mysql_fetch_row($ord);if (!empty($email)){$ontvanger = $email;}$to = EMAIL;$subject = "Request";$datas = "Dear Sir/Madam $name, Hereby the corfirmation of your request.We have inserted your data in our database (please check it up): No : $row[0] Name : $name Address : $address Zip : $zip City : $city Phone : $phone E-Mail : $email Kind data : $kinddata ";$header = "From: ".$name." <".$email.">\r\n"; $header .= "MIME-Version: 1.0\r\n";$header .= "Content-type: text/html; charset=iso-8859-1\r\n";$header .= "Reply-To: ".$name." <".$email.">\r\n"; @mail($to, $subject, $datas, $header);}?> Thank's, we wil answer your request soon. You have sent: Request No : <?php $ord = mysql_query("SELECT aanmldid FROM aanmelding ORDER BY aanmldid DESC LIMIT 1"); $row = mysql_fetch_row($ord); echo $row[0]; ?> Name : <?php echo $name;?> Address : <?php echo $address;?> Zip : <?php echo $zip;?> City : <?php echo $city;?> Phone : <?php echo $phone;?> E-Mail : <?php echo $email;?> Kidname Age Lesson <?php $kidname = isset($_POST["kidname"]) ? $_POST["kidname"] : array(); foreach($kidname as $value1) echo $value1.''; ?> <?php $age = isset($_POST["age"]) ? $_POST["age"] : array(); foreach($age as $value2) echo $value2.''; ?> <?php $lesson = isset($_POST["lesson"]) ? $_POST["lesson"] : array(); foreach($lesson as $value3) echo $value3.''; ?> D A T A B A S E<?php//select tabel $sql = "SELECT * FROM aanmelding ORDER BY aanmldid DESC";$res = mysql_query($sql);?> ID Name Address Zip City Phone E-mail Kid data $row[0] $row[1] $row[2] $row[3] $row[4] $row[5] $row[6] $row[7] Quote Link to comment Share on other sites More sharing options...
falkencreative Posted January 13, 2009 Report Share Posted January 13, 2009 Looks like you have the mail() function within a loop: foreach($_POST['kidname'] as $row => $value1) I'm guessing this isn't the way you want it, so you'll need to look at your opening and closing brackets, and confirm they are all in the correct locations. Quote Link to comment Share on other sites More sharing options...
redskin Posted January 14, 2009 Author Report Share Posted January 14, 2009 (edited) T e s t Kid informations Kidname Age Lesson selectChinesGermanFranceEnglishItalianNederlandsSpain [+] [-] Parent informations Name : Address : Zip : City : Phone : Email : <?foreach($_POST['kidname'] as $row => $value1){$kidname = mysql_real_escape_string($value1);$age = mysql_real_escape_string($_POST['age'][$row]);$lesson = mysql_real_escape_string($_POST['lesson'][$row]);}$kdata = $kidname."".$$age."".$lesson;?> Edited January 14, 2009 by redskin Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.