Jump to content

Drupal php include of WHMCS PHPs


keytekweb

Recommended Posts

Hi

 

I have recently installed Drupal as my CMS and have installed WHMCS in a subfolder called 'packages'.

 

My aim was to create pages under a Drupal theme and perform some sort of 'include' to get WHMCS content to appear as the body of the pages.

 

In principal this works except that any pages that require a login within WHMCS always appear as logged out i.e. The login screen appears instead of the page content.

 

I am using absolute includes e.g. in my drupal page /client-area I have

<?php include http://my.domain.com/packages/clientarea.php ?>

 

If I use relative urls(./packages/clientarea.php) I get absolutely nothing. This is possibly

to do with smarty or something

 

Can someone tell me if there is a solution for this i.e Can I include WHMCS files in external PHPs under the same domain.

 

Any help much appreciated

Thanks

Eugene Martin

Link to comment
Share on other sites

Hi

 

It is indeed to do with sessions.

 

I tried for 3 days to sync the sessions even passing the session ID along with the request. I had a little success with this but for some reason the "upw" variable was being stripped from the session within WHMCS.

 

I have found a solution that for me is sufficiently acceptable. I have decided to use the much maligned iframe within my drupal pages to include WHMCS content.

 

I have found some very nice code here

http://www.wolfcreekconsulting.com/support/techlib/web/DynamicallyResizedIframesDemo.php

to reshape the iframe on reload of its content. This means crucially that there are no ugly scroll bars on your iframe.

 

Select view page source to view code.Remove all the table related html from his example and just use the iframe tag.

 

One important thing I discovered was that an http iframe cannot resize itself based on https

content and vice versa. Therefore it is important to mod rewrite all http links within Drupal to https and to set your WHMCS installation to always deliver in https(This is done by setting the system url to https://www.yourdomain.com/whmcs and blanking out the WHMCS SSL System URL. All this is in General settings of WHMCS admin)

 

Hope that helps someone

Eugene Martin

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