WHMCS Integration - php include

I'm really having a bit of trouble trying to get a page to display the content that I want and I'm at a loss on how to get it to do exactly what I want.

I'm trying to use the WHMCS plugin and insert some php code into the "page" under the text editor tab option.

Simply put, I want to include the following: (php tags removed so it will show)

include '/home/username/public_html/members/domainchecker.php';

The domainchecker.php file is one that is a native file for the WHMCS billing system which loads like this page: https://mypchost.com/my-account/active/domainchecker.php

What I'd like to do is have the ability to add a banner/slider and other content on the page as well, not just create a straight link to the domainchecker.php file in WHMCS. Everything I've tried fails. I've tried multiple plugins and methods to get it to display, however, I think that there is something within the plugin itself that is causing this issue, even using shortcodes.

I've tried straight php and the shortcodes. Either way, the code fails to execute or shows a WHMCS error "Err 2" when doing so. How can I get this to allow shortcodes and/or execute php within a page itself?

Thanks in advance.
Matt

  • Vinod Dalvi

    Hi Matt,

    Welcome to the WPMU Dev community. and thank you for your question.

    I've tried straight php and the shortcodes. Either way, the code fails to execute or shows a WHMCS error "Err 2" when doing so. How can I get this to allow shortcodes and/or execute php within a page itself?

    Let me know which shortcodes you are using.

    You can use following plugin to execute PHP code in page.
    http://wordpress.org/plugins/shortcode-exec-php/

    Please advise if you have more questions.

    Best Regards,
    Vinod Dalvi

  • Matt

    Nope - as I said, it does not work with plugins for whatever reason. I think that Arnold needs to be contacted in regards to this. I have tried every possible plugin for executing php code within a page or post that I could find and nothing executes it due to the whmcs integration plugin and how it apparently handles the code.

    This is the result of the "test" after putting the following code into the box: include '/home/mypchost/public_html/members/domainchecker.php';

    <div style="border: 1px dashed #cc0000;font-family:Tahoma;background-color:#FBEEEB;width:100%;padding:10px;color:#cc0000;">Down for Maintenance (Err 2)
    An upgrade is currently in progress... Please come back soon...</div>

    So something within the WHMCS integration plugin is interfering with the execution of the php code I am trying to add. Not quite sure what you mean by "which shortcodes" because each php execute plugin that I have used is slightly different. I'm not using any shortcode from the WHMCS integration plugin... because there isn't one to display the whmcs page "domainchecker.php" - only for account, stats, etc., not for individual pages. I hope that I've more clearly explained this so its better understood.

  • Vinod Dalvi

    Hi Matt,

    Thank you for your reply.

    I have tried every possible plugin for executing php code within a page or post that I could find and nothing executes it due to the whmcs integration plugin and how it apparently handles the code.

    Does it work if you deactivate WHMCS WP Integration plugin?

    Not quite sure what you mean by "which shortcodes" because each php execute plugin that I have used is slightly different.

    In your question you have mentioned :

    "How can I get this to allow shortcodes and/or execute php within a page itself?"

    Therefore i wanted to know which shortcodes you are referring.
    Is it from plugin / theme or default WordPress shortcode or custom developed shortcode as default WordPress shortcode like [gallery] should work fine.

    Kind Regards,
    Vinod Dalvi

  • Matt

    I have tried simply with shortcode and the php code and neither appear to work with the whmcs integration disabled. I can send a user/pass so that you can see what I am referring to. These are the plugins and methods I have tried so far.

    http://wordpress.org/plugins/allow-php-in-posts-and-pages/
    http://wordpress.org/plugins/shortcode-exec-php/
    http://wordpress.org/plugins/php-code-for-posts/
    http://wordpress.org/plugins/insert-php/

    PHPtag include '/home/mypchost/public_html/members/domainchecker.php'; PHPtag

    PHPtag include 'https://members.mypchost.com/domainchecker.php'; PHPtag

    All of these methods have failed. I'm at a complete loss. I've never before found the need to do so, but I do now, and all the plugins I've tried do not seem to work correctly. The theme is custom and does not use any shortcodes or anything (self created, first theme ever). I DO know that shortcode works as the shortcode that is included in the WHMCS integration plugin works fine on the page it should. So either a configuration or the fact that the whmcs integration is coming in from a subdomain I think is causing this. Maybe I'm totally offbase with this as I'm new to wordpress too, but everything appears to be coded properly.

    I think anything at this would make a dent lol Let me know if you'd like a login so you can see whats going on first hand.

    Thanks again for the reply.

  • Vinod Dalvi

    Hi Matt,

    Thanks for your detailed reply.

    Please send me your admin credentials so that i can troubleshoot it
    - Send an email using our secure contact form on https://premium.wpmudev.org/contact/
    - Select "I have a different question" from the dropdown
    - On the subject enter "Attn: Vinod Dalvi".
    - Include the URL of this post in your message so that I may track this issue better
    - Include a link to your website
    - Include your admin credentials (username + password)
    - Include FTP Details

    Regards,
    Vinod Dalvi

  • Arnold

    You cannot run WHMCS files in WordPress. No use even trying.

    What you can do is make a link to your current content page

    https://mypchost.com/my-account/active/domainchecker.php/?

    and it will take you right to the domainchecker page.

    If you want other stuff on the page make a separate page say call it Checker with a slug of /checker/ Add the [wcp_content] shortcode and any other things like your slider and the new url would be

    https://mypchost.com/checker/active/domainchecker.php/?

  • Matt

    @Arnold,

    Yeah - I've done that on the site, I think similar to what you've suggested with different content. I was trying to pull the actual domain checker page, which lists all the domains, prices, etc. onto the same page so that when a customer loads it, I would have my graphical ads, content and any other things on it. I currently use the whmcs integration plugin short codes in a few different ways.

    Guess I'll have to just stick with it or edit the tpl page in whmcs to load the content then.

    Thanks for the support guys - much apprreciated. I thought I was losing it for awhile and didn't understand why the page wasn't executing the code to bring in the content. Knew you'd have the answer Arnold. Thanks Dalvi for checking into this and staying on top of it.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.