<?php
ini_set("display_errors","1");
ini_set("display_startup_errors","1");
header("Expires: Thu, 01 Jan 1970 00:00:01 GMT"); 
set_magic_quotes_runtime(0);

include("oldinclude/dbcommon.php");
include("oldinclude/##@TABLE.strShortTableName s##_variables.php");
##if @BUILDER.arrLanguages.len>1##
include("oldinclude/languages.php");
##endif##

$conn = db_connect();

$field = GetFieldByGoodFieldName(postvalue('field'));
$value = postvalue('value');

##if @BUILDER.bCreateLoginPage##
##if @TABLE.strDataSourceTable!=@BUILDER.strLoginTable##
	if(!@$_SESSION["UserID"]) { return;	}
	if(!CheckSecurity(@$_SESSION["_".$strTableName."_OwnerID"],"Edit") && !CheckSecurity(@$_SESSION["_".$strTableName."_OwnerID"],"Add") && !CheckSecurity(@$_SESSION["_".$strTableName."_OwnerID"],"Search")) { return;	}
##else##
	if ( 1==1
	##foreach @BUILDER.Registration.arrUserFields as @u##
		&& $field!="##@u s##" 
	##endfor##
	) {
		if(!@$_SESSION["UserID"]) { return;	}
		if(!CheckSecurity(@$_SESSION["_".$strTableName."_OwnerID"],"Edit") && !CheckSecurity(@$_SESSION["_".$strTableName."_OwnerID"],"Add") && !CheckSecurity(@$_SESSION["_".$strTableName."_OwnerID"],"Search")) { return;	}
	}
##endif##
##endif##

$output = loadSelectContent($field, $value);

foreach( $output as $value ) {
	echo $value."\n";
}

?>