@duncanc good mornig thank you for your email
Probably i have not clearly stated the situation. Of course phlist create tracking itself and sugar as well. As follow an example of tracking link from sugar http://www.myexampledomain.xxx/crm/index.php?entryPoint=campaign_trackerv2&track=XXXXXXXX-cedc-bbe6-5380-47fa301c18d2&identifier=XXXXX-8902-607f-bd63-62b57d9a4e95
I belive phplist create links similar, is it correct ?
Even if Sugarcrm is not installed on server with registerd domain in can create link with external domain. Because on external domain there is no database and software then on public website needs to add some pice of code for redirection
crmlocation.php
<?php
$crmlocation = 'http://static-ip-address:80/crm';
?>
index.php
<?php
require_once('../mdb-database/crmlocation.php');
function _iscurlinstalled() {
if (in_array ('curl', get_loaded_extensions())) {
return true;
}
else{
return false;
}
}
function http_parse_headers($header)
{
$retVal = array();
$fields = explode("\r\n", preg_replace('/\x0D\x0A[\x09\x20]+/', ' ', $header));
foreach( $fields as $field ) {
if( preg_match('/([^:]+): (.+)/m', $field, $match) ) {
$match[1] = preg_replace('/(?<=^|[\x09\x20\x2D])./e', 'strtoupper("\0")', strtolower(trim($match[1])));
if( isset($retVal[$match[1]]) ) {
$retVal[$match[1]] = array($retVal[$match[1]], $match[2]);
} else {
$retVal[$match[1]] = trim($match[2]);
}
}
}
return $retVal;
}
function HTTPost($host, $path, $data_to_send,$user,$pass,$agent) {
$fp = fsockopen($host,80, &$err_num, &$err_msg, 10);
if (!$fp) {
print "errore";
echo "$err_msg ($err_num)<br>\n";
} else {
$auth = $user.":".$pass ;
$string=base64_encode($auth);
echo $string;
fputs($fp, "POST $path HTTP/1.1\r\n");
fputs($fp, "Authorization: Basic ".$string."\r\n");
fputs($fp, "User-Agent: ".$agent."\n");
fputs($fp, "Host: $host\n");
fputs($fp, "Content-type: application/x-www-form-urlencoded\n");
fputs($fp, "Content-length: ".strlen($data_to_send)."\n");
fputs($fp, "Connection: close\n\n");
fputs($fp, $data_to_send);
$res = '';
for ($i = 1; $i < 10; $i++){
$reply .= fgets($fp, 256);
}
fclose($fp);
}
return $reply;
}
if ($_REQUEST['entryPoint'] == 'removeme' || $_REQUEST['entryPoint'] == 'campaign_trackerv2' || $_REQUEST['entryPoint'] == 'image') {
if (strlen($_REQUEST['identifier']) == 36) {
if (strlen($_REQUEST['track']) > 0) {
$reply = HTTPost($sugarhost,$sugarindex,"entryPoint=".$_REQUEST['entryPoint']."&identifier=".$_REQUEST['identifier']."&track=".$_REQUEST['track'],"","",$_SERVER['HTTP_USER_AGENT']);
$arr = array();
$arr = http_parse_headers($reply);
if (array_key_exists('Location',$arr)) {
header("Location: $arr[Location]");
}
} else {
HTTPost($sugarhost,$sugarindex,"entryPoint=".$_REQUEST['entryPoint']."&identifier=".$_REQUEST['identifier'],"","",$_SERVER['HTTP_USER_AGENT']);
}
}
}
?>
Then the first question is
even if installed over LAN is possible to have phplist creating tracking links like
http : // www.myexampledomain.xxx/afolder/blablablabla
instead of
http : // localhost/blablabla ???