Jump to content

Using PHP Code within Templates


KMETAVZER

Recommended Posts

Hallo,

I have a question, I've made this script, and I've put it on the page "clientareahome.tpl".

 

{php}
$userid = $this->_tpl_vars['userid'];

$result = mysql_query("SELECT id FROM tblinvoices WHERE userid=$userid");
$totalnuminvoices = mysql_num_rows($result);
echo "<p>Number of Invoices: <a href=\"clientarea.php?action=invoices\"><strong>". $totalnuminvoices ."</strong> - View »</a></p>";

$result = mysql_query("SELECT id FROM tblemails WHERE userid=$userid");
$totalnumemails = mysql_num_rows($result);
echo "<p>Number of Emails: <a href=\"clientarea.php?action=emails\"><strong>". $totalnumemails ."</strong> - View »</a></p>";

echo "USERID=". $userid;
{/php}

 

Here working all except the this line:

$userid = $this->_tpl_vars['userid'];

 

Here is the template syntax:

http://docs.whmcs.com/Template_Syntax

 

Somebody know how to solve the problem ?

Thank you for any suggestion.

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.

Guest
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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • 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