Aggiunta connessione con mysql

This commit is contained in:
gine 2016-10-16 17:44:52 +02:00
parent 1e6b4a1374
commit a7de9454ae

View file

@ -1,6 +1,8 @@
<?php
require_once 'vendor/phpmailer/phpmailer/PHPMailerAutoload.php';
include_once 'config/config.php';
include_once "vendor/notorm/NotORM.php";
function getToken($length = 12){
return uniqId();
@ -17,6 +19,14 @@ function generateLink($url, $token, $ml, $email){
return $link.$token.$ml.$email;
}
$pdo = new PDO("mysql:host=".$db_host.";dbname=".$db_dbname,
$db_user,
$db_pass
);
$db = new NotORM($pdo);
var_dump($db);
exit();
$mail = new PHPMailer;
//$mail->SMTPDebug = 3; // Enable verbose debug output
@ -42,6 +52,8 @@ while(!feof($file)){
$token = getToken();
$link = generateLink($mlrollmember_url, $token, $ml, $sanitized_mail);
$mail->AltBody = $def_body.$link;
if(!$mail->send()) {
echo 'Message could not be sent.';