Beste lezer,
Onderstaand werkte tot php5.5 helemaal correct in mysql. Nadat er foutmeldingen waren omdat de queri NIET toegevoegd werd aan de atabase, probeer ik nu het geheel om te zetten naar MYSQLI. Maar het werkt niet en van de nieuwe taal weet ik te weinig om de fout te vinden. Wil iemand mij helpen?
<?php
$where_form_is="http://".$_SERVER['SERVER_NAME'].strrev(strstr(strrev($_SERVER['PHP_SELF']),"/"));
session_start();
if( ($_SESSION['security_code']==$_POST['security_code']) && (!empty($_POST['security_code'])) ) {
include("config.inc.php");
$link = mysqli_connect($db_host,$db_user,$db_pass);
/* check connection */
if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
exit();
}
mysqli_select_db($db_name,$link);
$query = "INSERT into `".$db_table."` (familyname,firstnames,nationality,eu,gender,dateofbirth,adress,postalcode,city,countryofresidence,phone,skype,email,lifepartner,children,specialneeds,previousdegree,emms,emmsyear,firstproject,secondproject,cveuropass,passport,motivation,diploma,firstreclet,secondreclet,studyresults,languageresult,password) VALUES ('" . $_POST['familyname'] . "','" . $_POST['firstnames'] . "','" . $_POST['nationality'] . "','" . $_POST['eu'] . "','" . $_POST['gender'] . "','" . $_POST['dateofbirth'] . "','" . $_POST['adress'] . "','" . $_POST['postalcode'] . "','" . $_POST['city'] . "','" . $_POST['countryofresidence'] . "','" . $_POST['phone'] . "','" . $_POST['skype'] . "','" . $_POST['email'] . "','" . $_POST['lifepartner'] . "','" . $_POST['children'] . "','" . $_POST['specialneeds'] . "','" . $_POST['previousdegree'] . "','" . $_POST['emms'] . "','" . $_POST['emmsyear'] . "','" . $_POST['firstproject'] . "','" . $_POST['secondproject'] . "','".$where_form_is."files/".$cveuropass_filename."','" .$where_form_is."files/".$passport_filename. "','" .$where_form_is."files/".$motivation_filename. "','" .$where_form_is."files/".$diploma_filename. "','".$where_form_is."files/".$firstreclet_filename."','".$where_form_is."files/".$secondreclet_filename. "','".$where_form_is."files/".$studyresults_filename. "','".$where_form_is."files/".$languageresult_filename. "','" . $_POST['password'] . "')";
mysqli_query($query);
$newid = mysqli_insert_id($link);
mysqli_close($link);
mail(($_POST['email']),"Form confirmation","
Dear Madam or Sir " . $_POST['familyname'] . ",
Thank you for your application.
Your ID-number is: $newid.
Please use this ID-number in all correspondence with the coordinator.
You will be informed if your application is eligible before end of February 2014.
If you have any further questions, you can contact the coordinator at [email protected]
With kind regards,
");
}
?>
[size=xsmall]Toevoeging op 08/01/2014 12:56:18:[/size]
Oh ja, ter anvulling: de mail aan het eind wordt keurig verzonden maar er wordt nieuts in de database opgenomen.
4.154 views