Posts tagged whmcs

Whmcs Custom Fields Validation

0

Regular Expression Validation

The regular expression validation rules allow you to define what value the field can take. The user won't be allowed to proceed until it passes the validation rule. Some common examples you might want:

A domain name in the format "google.com"

/^([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-]+)*\.([a-zA-Z]{2,6})$/

A username between 4 and 28 characters in length, alpha-numeric, and allowing underscores

/^[a-z\d_]{4,28}$/i

A telephone number in the following format: (###) ###-####

/^(\(?[0-9]{3,3}\)?|[0-9]{3,3}[-. ]?)[ ][0-9]{3,3}[-. ]?[0-9]{4,4}$/

A date in the format DD/MM/YYYY

/^\d{1,2}\/\d{1,2}\/\d{4}$/

See http://www.regexpr.com/cheatsheet/ for a detailed guide

 

http://docs.whmcs.com/Custom_Fields#Types_of_Custom_Fields

Whmcs Custom Fields

0

{php}
$userid = $this->_tpl_vars['clientsdetails']['userid'];
$result = mysql_query("SELECT value FROM tblcustomfieldsvalues WHERE relid=$userid AND fieldid=###");
$data = mysql_fetch_array($result);
$value = $data["value"];
echo $value;
{/php

### olan yeri custom field id numarası ile değişelim.

Go to Top