/* function get_key_from_value ($value, $array) {
if (is_array ($array)) {
if (!in_array ($value, $array)) {
ksort ($array);
end ($array);
$key = key ($array) + 1;
$array[$key] = $value;
} else {
$key = array_search ($value, $array);
}
} else {
$key = 1;
$array[$key] = $value;
}
return $key;
} */
function get_site_path() {
$proto = $_SERVER['HTTPS'] ? 'https://' : 'http://';
$host = $_SERVER['SERVER_NAME'];
if (!isset($_SERVER['REQUEST_URI'])) {
$_SERVER['REQUEST_URI'] = substr($_SERVER['PHP_SELF'],1 );
if (isset($_SERVER['QUERY_STRING'])) { $_SERVER['REQUEST_URI'].='?'.$_SERVER['QUERY_STRING']; }
}
$uri = preg_replace("/\?.*/", '', $_SERVER['REQUEST_URI']);
$base_uri = substr($uri, 0, strrpos($uri, "/"));
$file = substr($uri, strrpos($uri, "/") + 1, strlen($uri));
return array("proto"=>$proto, "host"=>$host, "base"=>$base_uri, "filename"=>$file);
}
function check_address ($address) {
$address = trim($address);
return preg_match('/^(?:[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+\.)*[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+@(?:(?:(?:[a-zA-Z0-9_](?:[a-zA-Z0-9_\-](?!\.)){0,61}[a-zA-Z0-9_-]?\.)+[a-zA-Z0-9_](?:[a-zA-Z0-9_\-](?!$)){0,61}[a-zA-Z0-9_]?)|(?:\[(?:(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\.){3}(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\]))$/', $address);
}
?>
Parse error: syntax error, unexpected 'new' (T_NEW) in /hermes/walnacweb03/walnacweb03ah/b770/moo.bellat/nerousa/php/sm_cart.php on line 439