Jump to content

Issue assigning values to hostname, ns1 prefix and ns2 prefix input fields via URL parameters


Recommended Posts

Hello WHMCS community,

I need to assign values via the url parameters that come from my corporate website's order form to the input fields found in the configureproduct.tpl, in whmcs portal.

Currently, all values are carried over from my corporate site to my whmcs portal except for the input fields of hostname, ns1 prefix and ns2 prefix.

Now, I can see  through the dev tools that the fields of hostname, ns1 and ns2 have their values assigned in the url parameters as the rest of the values that are carried over that refer to configoption ids:

From my corporate site:



the url parameters sent to WHMCS portal:


In addition, I customized the hostname input field to have a value auto-assigned based on $smarty.now|date_format:'%Y%m%d%H%M%S' whenever the input submitted (through the url parameter or not) to the said field is null.

My approach on this in regards to configureproduct.tpl can be seen in the following lines for the input field of hostname:

<input type="text" name="hostname" class="form-control" id="inputHostname" value="{if empty($smarty.get.hostname)}VL{$smarty.now|date_format:'%Y%m%d%H%M%S'}{else}{$smarty.get.hostname}{/if}">

Unfortunately, Smarty insists on acknowledging the URL parameters of those three input fields as null or empty. 

And thus, I get the following result in WHMCS portal:


Ι have also tried implementing these through $smarty.get.variablename, $smarty.request.variablename as well as by assigning the values  via the following script:

{assign var="hostname" value="{$smarty.get.hostname}"}
{assign var="ns1prefix" value="{$smarty.get.ns1prefix}"}
{assign var="ns2prefix" value="{$smarty.get.ns2prefix}"}

Any aid you can provide on this will be much appreciated.

Kind regards,


Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated