| 
<?PHP
# static/ is folder with images
 # this dir is also available via de static domain; http://static.domain.com/
 # you can get the different language version of the TrialPay get it free button from the merchant site of trialpay.com
 define('STATICURL', 'http://static.domain.com');
 
 $_SESSION['lng'] = "en";
 include_once("trialpay.class.php");
 
 
 function GetTrialPImg(){
 $img = "trialpay_free_en.gif";
 if(isset($_SESSION['lng'])){
 $lng = strtolower($_SESSION['lng']);
 if(file_exists("static/trialpay_free_$lng.gif")){
 $img = "trialpay_free_$lng.gif";
 }else{
 $img = "trialpay_free_en.gif";
 }
 }else{
 $img = "trialpay_free_en.gif";
 }
 return $img;
 }
 
 function MakeTrialPayButton($cUrl,$minAmount,$productname,$proddescr,$price,$currency,$prodid,$custParams = array()){
 $tp = new TrialPay();
 $tp->SetEncType("aes");
 $tp->SetCustomParams($custParams);
 $tp->CreateFormAction($cUrl);
 $tp->CreateMessage($minAmount,$productname,$proddescr,$price,$currency,$prodid);
 $tpimg = STATICURL."/".GetTrialPImg();
 $button = $tp->CreateForm($tpimg,145,65,"tpbut");
 echo $button;
 }
 
 ?>
 |