\n"; return(mail("\"".$contactname."\" <".$contactemail.">", $subject, $message, $headers)); } function is_email_valid($email) { if(eregi("^[a-z0-9\._-]+@+[a-z0-9\._-]+\.+[a-z]{2,3}$", $email)) return TRUE; else return FALSE; } function quote_smart($value) { if (get_magic_quotes_gpc()) { $value = stripslashes($value); } if (!is_numeric($value)) { $value = "'" . mysql_real_escape_string($value) . "'"; } return $value; } $ip = $_SERVER['REMOTE_ADDR']; $dbh=mysql_connect ("localhost", "healthy_healthy", "johnflorybond") or die ('I cannot connect to the database.'); mysql_select_db ("healthy_living"); $host = $_SERVER["HTTP_HOST"]; $cp = strpos($host,'healthy-living.org'); if ($cp === false) $sub = $host; elseif ($cp == 0) $sub = 'www'; else $sub = substr($host,0,$cp-1); $cp = strpos ($sub,'www.'); if ($cp === false) {} elseif ($cp == 0) $sub = substr($sub,4); $path = substr($_SERVER["SCRIPT_NAME"],1); //create email to send if ($Submit == 'Subscribe to Free Newsletter') { $Submit = 'Subscribe to Healthy-Living.Org Newsletter'; $flag = 1; } if ($Submit == 'Subscribe to Healthy-Living.Org Newsletter') { if ($first) $url_first = urlencode($first); elseif (!$flag) $errors .= "
|
|
|