Jump to content

Custom pages outside WHMCS


yggdrasil

Recommended Posts

Does someone know if its possible to have whmcs template code in an external php page outside WHMCS?

 

Creating custom pages in whmcs requires them to be inside the whmcs root folder but I need to implement the logged if condition outside whmcs on a specific page, so it should be displayed only if a whmcs user is logged in.

 

Is this possible? Maybe linking the code directly to the whmcs path and including the PHP include functions into the page? If not I will have to use the api, but since whmcs is on the same domain I assume this should work.

Link to comment
Share on other sites

The only thing i am aware of to try this is to use the js sessionStorage

 

https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Storage

 

there are some examples about a quarter way down the page

 

 


// Save data to the current session's store
sessionStorage.setItem("username", "John");

// Access some stored data
alert( "username = " + sessionStorage.getItem("username"));

 

 

i was going to try to use this awhile back (just never got to it) because i have a recruitment popup that comes up on the page after 2 min. And i wanted to stop that popup if the user was already logged in or on the reg page and i was going to try to use the storage to set a flag. But i never got around to the project its still on the list.

 

So you might try that.

Link to comment
Share on other sites

But why exactly if it the page is using the same local server, php sessions and databases?

 

I saw some modules of people that integrated whmcs with wordpress and other CMS as well, this means they had to pull the data somehow, said this I assume this is possible, since the data and even php sessions are stored in the same domain.

 

I don't need anything fancy either just a basic conditional.

 

I wonder how those modules did it since I'm sure this run outside whmcs.

Link to comment
Share on other sites

Let's say that I've my WHMCS installed on example.com and my Wordpress on a different domain/server like whatever.com. On my Wordpress I can create a page that gets/sends data from/to WHMCS via API. This is how you integrate an external page with WHMCS. In case WHMCS and Wordpress are on the same domain/server, unless there are no special settings on your webserver, you could try to require("relative/path/to/init.php"); and initialize Smarty.

Link to comment
Share on other sites

+1 kian

 

you can also include a hook file, i have not tried this on a seperate domain it may not be possible, but on the same domain you can create a hook in whmcs and then have those results captured in your external file which is along the same lines as what kian was saying.

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