Skip to content

Instantly share code, notes, and snippets.

@mauromarano
mauromarano / mail.php
Created November 11, 2012 12:19
Function to send email (in html) with php
function email2($to, $title, $text, $from_email, $from_name ){
// costruiamo alcune intestazioni generali
$header = "From: ".$from_name." <".$from_email.">\n";
$header .= "X-Mailer: Il nostro Php\n";
// costruiamo le intestazioni specifiche per il formato HTML
$header .= "MIME-Version: 1.0\n";
$header .= "Content-Type: text/html; charset=\"iso-8859-1\"\n";
$header .= "Content-Transfer-Encoding: 7bit\n\n";
@mauromarano
mauromarano / getCookie.js
Created October 16, 2012 14:41
getcookie from javascript
function getCookie(c_name){
var i,x,y,ARRcookies=document.cookie.split(";");
for (i=0;i<ARRcookies.length;i++){
x=ARRcookies[i].substr(0,ARRcookies[i].indexOf("="));
y=ARRcookies[i].substr(ARRcookies[i].indexOf("=")+1);
x=x.replace(/^\s+|\s+$/g,"");
if (x==c_name){
return unescape(y);
}