Jump to content
Sign in to follow this  
twister

how to export session UID variable to a php file

Recommended Posts

Hi guys,

I have a php file executing some mysql queries with variables parsed by Ajax , this is why i can't do the queries directly in php tags in the WHMCS template.

So basically there is a query.php file that i need to export the session variable to for further usage.

I need this variable in that file

 

{php}


echo $_SESSION['uid'];


{/php}
 

so i can use it for further manipulations. 

Share this post


Link to post
Share on other sites

found a solution using ajax and javascript. here's an e.g. of function:

function funonclick2() {
 var id ='{$clientsdetails.userid}';

$.ajax({
type: "POST",
url: 'test-query.php',
data: { id: id },
success: function(id)
{
 }
});

}

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.

Sign in to follow this  

  • Similar Content

    • By JesusSuarz
      Hello
      I have a variable that is printed with {debug} in the tpl template.
      however I want to get the result in php of this variable.
      I need to get $customfields from a hook.
      how could you access $customfields that is printed inside a product
       
      @brian! could you help me?
    • By ModulesGarden
      1. Plesk Extended For WHMCS 3.5.0

      Because your system can never suffer from too many user-friendly features, today we are storming ahead with a solid update of Plesk Extended For WHMCS 3.5.0 that is about to nurture your web hosting business in more than a few different ways:
       
      Take maximum advantage of the newly introduced support for WHMCS V8.1 and "Twenty-One" theme. In order to limit the system resources consumed by PHP scripts, your clients are now allowed to use a custom PHP version and configurations per website. While in the comfy surroundings of the client area, let us also move a bit further to the new "Log Rotation" section where your customers can manage conditions for the log files to be cleaned up once they are too old or too big.
      Be sure to enjoy the full changelog available on our website!



      2. SMS Center For WHMCS 3.8.0

      Just as much deserving of a special mention is SMS Center For WHMCS, specifically because of its spanking-new 3.8.0 update!

      The module’s scope of support has been broadened to integrate well with as many as five all-new SMS gateways. Thanks to it, the official list of available SMS gateways now includes 51 providers in total!

      Additionally, the product has also received a series of tweak-ups so as to secure its rock-solid compatibility with both WHMCS V8.1 and "Twenty-One" system theme.

      Keep in touch with your customers no matter the time and place!



      3. Under the Microscope: MetricsCube Live Dashboard for WHMCS

      Reading through your business data feels as though you were reading a foreign language?

      Live Dashboard for WHMCS that forms a central part of MetricsCube communicates crucial metrics in a visual format to make all complex relationships in your data self-explanatory. Drop by the MetricsCube blog as soon as you can to get a close-up look at every single report and graph illustrating the real-time performance of your WHMCS business down to the last detail.

      Take an insightful stroll through the data-filled confines of Live Dashboard!



      Need Custom Software Development For Your Business?
       
      Get Your Free Quote Now! Specially for you we will adapt an application and its design to your own needs, create a new module or even a completely new system built from scratch!
    • By JesusSuarz
      sometimes the client can have 2 emails.
      one for your account details and one for the account owner.
      I need to know if the account owner's email is verified.
      The var: 
      $client = Menu::context("client"); gets the email that the customer has in the account details, however this is not the email owner of the account.
      I hope to make myself understood correctly.
       
    • By Eugene.Viljoen
      Hi,
      Sorry if this has been asked before but i can seem to find any solution for it!
      I am looking for a way to display a "Network Status" icon/ css on the home page of my website based on the WHMCS network status rss feed (https://portal.whmcs.com/networkstatusrss.php).
      The concept is to have the icon/css auto change when one of the following network issues are opened rather then having to change it manually.
      Low Medium High Critical Attached is an illustration of what i am looking at doing.
      PS: I already wrote the css to have pluse icons, just need to implement the second part.
      Thank you in advance! 😁
       
    • By cdeese8
      What's the best way to add a snippet of PHP inside a .tpl file? It looks like everybody recommends against using the {php}{/php} bracket for security reason. Should I be creating my .php snippet file in root WHMCS directory and just using include to beam it in?
      {php} include "my-php-snippet.php"; {/php} I'm looking to "add recent wordpress posts to non wordpress site" and they all involve adding php snippet to include the wp-load.php file. It'd be cool if I can avoid using an <iframe> too. This is the snippet I'd like to add a .tpl page:
      <?php // Include the wp-load'er include('/public_html/wordpress/wp-load.php'); // Get the last 10 posts // Returns posts as arrays instead of get_posts' objects $recent_posts = wp_get_recent_posts(array( 'numberposts' => 10 )); // Do something with them echo '<ul>'; foreach($recent_posts as $post) { echo '<li><a href="', get_permalink($post['ID']), '">', $post['post_title'], '</a></li>'; } echo '</ul>'; ?> * whmcs 7.4 is installed on root domain, and the wordpress site is installed in a subfolder
      * https://davidwalsh.name/wordpress-recent-posts
      * https://www.webmoves.net/blog/web-design-development/display-wordpress-posts-outside-of-wordpress-3081/
       
       
  • 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