Jump to content
hogava

use whmcs login section for access custom php file

Recommended Posts

Hello

I need to use WHMCS login system for access custom PHP file?

I created a php file in folder inner of whmcs and now i want just admin of whmcs can see this page. please help me about implementation of that. 

thanks

Share this post


Link to post
Share on other sites

Someone can help me on how to use condition for WHMCS's logged-in admin in custom php page.

Share this post


Link to post
Share on other sites

Hello,

This can be done by first calling the WHMCS init file:

require_once ("/home/path/public_html/whmcs/init.php");

Then you can use the following to check if a user is logged-in to WHMCS:

<?php

if ($_SESSION['uid']) {


}

?>

Jack

Share this post


Link to post
Share on other sites

THANKS

uid is id of client or is for whmcs admins?

Edited by hogava

Share this post


Link to post
Share on other sites
2 hours ago, hogava said:

THANKS

uid is id of client or is for whmcs admins?

uid is for the client. This code has been working for me for many versions now.

Share this post


Link to post
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