run:R W Run
992 By
2026-04-08 19:24:44
R W Run
656 By
2026-04-08 19:24:43
R W Run
810 By
2026-04-08 19:24:43
R W Run
1.73 KB
2026-04-08 19:24:43
R W Run
1.79 KB
2026-04-08 19:24:44
R W Run
39 By
2026-04-08 19:24:43
R W Run
4.49 KB
2026-04-08 19:24:45
R W Run
3.63 KB
2026-04-08 19:24:45
R W Run
error_log
📄domainprice.php
1<?php
2
3use WHMCS\Application;
4use WHMCS\Billing\Currency;
5use WHMCS\Database\Capsule;
6
7require("../init.php");
8
9/*
10*** USAGE SAMPLES ***
11
12<script language="javascript" src="feeds/domainprice.php?tld=.com&type=register&regperiod=1"></script>
13
14<script language="javascript" src="feeds/domainprice.php?tld=.com&type=register&regperiod=1&currency=1&format=1"></script>
15
16*/
17$whmcs = Application::getInstance();
18
19$tld = $whmcs->get_req_var('tld');
20$type = $whmcs->get_req_var('type');
21$regperiod = $whmcs->get_req_var('regperiod');
22$format = ($whmcs->get_req_var('format')) ? true : false;
23
24if (!is_numeric($regperiod) || $regperiod < 1) {
25 $regperiod = 1;
26}
27
28$did = Capsule::table('tbldomainpricing')
29 ->where('extension', '=', $tld)
30 ->value('id');
31
32if (!empty($currency)) {
33 $currency = getCurrency(null, $currency);
34} else {
35 $currency = Currency::factoryForClientArea();
36}
37
38$validDomainActionRequests = array('register','transfer','renew');
39
40if (!in_array($type, $validDomainActionRequests)) {
41 $type = 'register';
42}
43
44$data = Capsule::table('tblpricing')
45 ->where('type', '=', 'domain' . $type)
46 ->where('currency', '=', $currency['id'])
47 ->where('relid', '=', $did)
48 ->where('tsetupfee', '=', '0.00')
49 ->first();
50
51$pricingColumns = array(
52 'msetupfee',
53 'qsetupfee',
54 'ssetupfee',
55 'asetupfee',
56 'bsetupfee',
57 'monthly',
58 'quarterly',
59 'semiannually',
60 'annually',
61 'biennially',
62);
63
64$regperiod = $regperiod - 1;
65$price = null;
66if (
67 isset($pricingColumns[$regperiod])
68 && is_object($data)
69 && property_exists($data, $pricingColumns[$regperiod])
70) {
71 $price = $data->{$pricingColumns[$regperiod]};
72}
73
74if ($format) {
75 $price = formatCurrency($price);
76}
77
78echo "document.write('".$price."');";
79