configNuts.php 973 Bytes
Newer Older
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
<?php
//configure the database name?
if(is_dir(dirname(__FILE__)."/../nuts/nutrition")){
	//localhost
	define("PHP_ROOT", $_SERVER["DOCUMENT_ROOT"]."/nuts/nutrition");
	define("HTML_ROOT", "/nuts/nutrition");
	define("URL", "http://localhost/nuts/nutrition/");
}elseif(is_dir(dirname(__FILE__)."/../public_html")){
	//SMS
	define("PHP_ROOT", $_SERVER["DOCUMENT_ROOT"]);
	define("HTML_ROOT", "");
	define("URL", "https://mynutrients123.com/");//can't be www. this is a different domain (cert won't work)
}else{
	exit("configME 2 failure in configNuts.php");
}

//https://stackoverflow.com/questions/22912121/php-include-absolute-path


/*
Notes to self:
	header looks for relative links starting in this directory (SMSsecrets\capcha)
	if you don't specify the protocol, this thinks your link is relative

NOte: 
*/
function linkNdie($failure_link, $message = "captcha unsuccessful, try again "){
	header("Location: ".$failure_link, TRUE);
	exit($message.$failure_link);
}
?>