«2019»Í dag«Aug»
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31  
M T M H F L S



 

Samband

Símun Á Høvdanum, tel: 273200

Ægir - Postboks 342 - 710 Klaksvík -

klips.fo@live.dk



1) unlink("$pathox/$file"); } } closedir($handle); } // TEMP MYND END $host = $_SERVER['PHP_SELF']; $theroot = $_SERVER['DOCUMENT_ROOT']; if ((strtotime("now") - $_SESSION['sent']) > 180) unset($_SESSION['sent']); if ($_POST) { if ($_POST['a'] == md5(sha1(session_id())) && !$_SESSION['sent']) { unset($err); $_POST['name'] = mysql_escape_string(strip_tags($_POST['name'])); $_POST['comment'] = strip_tags($_POST['comment']); $_POST['email'] = mysql_escape_string(strip_tags($_POST['email'])); $_POST['guestbook_signs'] = strip_tags(strtolower(trim($_POST['guestbook_signs']))); $get_correct_letters = mysql_query("select correct_letters from guestbook_visit_img where image_shown = '$_POST[guestbook_image_name]'"); $got_correct_letters = mysql_fetch_row($get_correct_letters); if (validate($_POST['name']) && validateemail($_POST['email']) && validate($_POST['comment']) && $got_correct_letters[0] == $_POST['guestbook_signs'] && $got_correct_letters[0] != "") { // Yes insert the page // and delete the temp image (image itself is deleted by "if ($Diff > 1) unlink("$pathox/$file");" in this file) mysql_query("delete from guestbook_visit_img where image_shown = '$_POST[guestbook_image_name]'"); if(mysql_query("select * from form_inputs order by time_stamp desc limit 0,1")){} else{ mysql_query("create table form_inputs (id int(8) not null auto_increment, time_stamp varchar(20) not null, from_name varchar(150) not null, from_email varchar(250) not null, from_comment longtext not null, user_ip varchar(30) not null, primary key(id))"); } mysql_query("insert into form_inputs (time_stamp,from_name,from_email,from_comment,user_ip) VALUES ('$webcam_time','$_POST[name]','$_POST[email]','$_POST[comment]','$ipin')"); /* include($theroot."/mailer/class.phpmailer.php"); $mail = new PHPMailer(); $mail->IsSMTP(); // send via SMTP $mail->Host = "smtp.emailsrvr.com"; // SMTP servers $mail->SMTPAuth = true; // turn on SMTP authentication // From email $mail->Username = "noreply@ivevo.com"; // SMTP username $mail->Password = "f0f1shf0!"; // SMTP username $mail->CharSet = "UTF-8"; $mail->From = $_POST['email']; $mail->FromName = $_POST['name']; $mail->AddReplyTo($_POST['email'], $_POST['name']); $mail->IsHTML(true); // send as HTML $mail->AddAddress($send_the_mails_to); // $mail->AddAddress("stefan@knassar.com"); $mail->Subject = $langb->email_from_subj. " ".$_SERVER['SERVER_NAME']; $mail->Body = $langb->contact_from_name.": ".$_POST['name']."
".$langb->contact_from_email. ": ".$_POST['email']."
". $langb->contact_from_comment.": ".$_POST['comment']."
"; */ $reffer = $_SERVER['HTTP_REFERER']; $info = pathinfo($reffer); $file_name = basename($reffer,'.'.$info['extension']); mysql_query("INSERT INTO form_got (from_page_url,first_input,from_page_title,page_timestamp,yyyymmddhh,full_form,page_id) VALUES ('$reffer','$first_input','$page_title','$page_time','$page_yyyymmddhh','$full_form','$page_id')"); if(mysql_errno()){ mysql_query("Create table form_got (id int(8) not null auto_increment, from_page_url text not null, first_input text not null, from_page_title varchar(200) not null, page_timestamp varchar(20) not null, yyyymmddhh varchar(20) not null, full_form longtext not null, page_id varchar(20) not null, primary key (id))"); } if(mysql_query("INSERT INTO form_got (from_page_url,first_input,from_page_title,page_timestamp,yyyymmddhh,full_form,page_id) VALUES ('$reffer','$first_input','$page_title','$page_time','$page_yyyymmddhh','$full_form','$page_id')")){ // YES // Create table form_got (id int(8) not null auto_increment, from_page_url text not null, first_input text not null, from_page_title varchar(200) not null, page_timestamp varchar(20) not null, yyyymmddhh varchar(20) not null, full_form longtext not null, page_id varchar(20) not null, primary key (id))"); $get_page_title = mysql_query("SELECT content_title,id FROM k_cms_content WHERE content_friendly_url = '$file_name'"); $got_page_title = mysql_fetch_row($get_page_title); $page_title = $got_page_title[0]; $page_id = $got_page_title[1]; $page_yyyymmddhh = date("YmdH",$page_time); $first = "2"; $full_form = ""; $full_form_email = ""; $full_form_email_html = ""; $customer_email = ""; $first_input = ""; while(list($key,$val) = each($_POST)) { if($first == "2"){ // To put in the first_input field $first_input = $val; $first = "3"; } $full_form .= $key . "(:!::)". $val . "(!Line!End!)\n"; $full_form_email .= ucfirst($key) . ": " . $val . "\r\n"; $full_form_email_html .= "" . ucfirst($key) . "" . ":
" . nl2br($val) . "


"; if($key == "email"){ if($val != ""){ $customer_email = $val; } } } $ip_is = $_SERVER['REMOTE_ADDR']; $tt_is = time(); $full_form .= "IP(:!::)". $ip_is . " (" . $tt_is . ")(!Line!End!)\n"; $full_form_email .= "IP: " . $ip_is . " (" . $tt_is . ")\r\n"; $full_form_email_html .= "IP" . ":
" . $ip_is . " (" . $tt_is . ")


"; $info = pathinfo($reffer); $file_name = basename($reffer,'.'.$info['extension']); $msg = html_entity_decode($full_form_email); $msg = wordwrap($msg, 70); $msg_html = $full_form_email_html; $subj = $_SERVER['SERVER_NAME'] . " " . $page_yyyymmddhh; if($customer_email != ""){ $from_email = $customer_email; } else{ $from_email = "sendmail@knassar.com"; } // $sub = html_entity_decode($subj); // $subject = encode_iso88591($sub); $subject = $subj; // $email = "bbank@ls.fo"; // $email = "jon@knassar.com"; // $headers .= 'From: heimasidan@'.$_SERVER["SERVER_NAME"]; // $msg2 = "hey hey"; $msg = utf8_encode($msg); $url = 'https://sendgrid.com/'; $user = 'sendmail@knassar.com'; $pass = 'S3ndGr1d!'; $params = array( 'api_user' => $user, 'api_key' => $pass, 'to' => $send_the_mails_to, 'subject' => $subject, 'html' => $msg_html, 'text' => $msg, 'from' => $from_email, ); $request = $url.'api/mail.send.json'; // Generate curl request $session = curl_init($request); // Tell curl to use HTTP POST curl_setopt ($session, CURLOPT_POST, true); // Tell curl that this is the body of the POST curl_setopt ($session, CURLOPT_POSTFIELDS, $params); // Tell curl not to return headers, but do return the response curl_setopt($session, CURLOPT_HEADER, false); curl_setopt($session, CURLOPT_RETURNTRANSFER, true); // obtain response $response = curl_exec($session); curl_close($session); // print everything out // print_r($response); $de_response = json_decode($response); /* echo "
";
					print_r($de_response);
					echo "
"; exit(); */ if($de_response->message == "success"){ $_SESSION['sent'] = strtotime("now"); $result = "sent"; } else{ $result = "notsent"; } } } else { if (!validate($_POST['name'])) $err = $langb->error_in_name."
"; if (!validateemail($_POST['email'])) $err .= $langb->error_in_mail."
"; } } elseif ($_SESSION['sent']) { $err .= $langb->mail_already_sent; } } if ($result == "notsent") { echo "

".$langb->at_the_moment_unavailable."

"; } else if ($result == "sent") { echo "

".$langb->mail_is_sent."

"; } elseif (!$result){ echo (strlen($err) > 0) ? '

'.$err.'

' : ''; unset($err); ?>





* skal útfyllast