The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Calling MySQL database in paper_lantern

Discussion in 'User Experience' started by timmmmyboy, Jul 14, 2015.

  1. timmmmyboy

    timmmmyboy Member

    Joined:
    Aug 26, 2013
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    I'm trying to integrate a piece of javascript code into paper_lantern and for a few parts of it I'll need to pull information from our client management database. I'm very familiar with connecting to a MySQL database using PHP but it seems like paper_lantern is all HTML so I'm at a loss as to how to get the data I need from a database for use in the template. Since I need this code to live in the footer of every page I can't just create a custom page that uses PHP. What are the best ways of doing this?
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    You could elaborate on the type of database content you are attempting to add to the footer through a PHP script? I'm not certain that it's going to work if you need it in the footer instead of as a plugin. Note that you may find this document helpful:

    Customize Content in Paper Lantern


    Thank you.
     
  3. timmmmyboy

    timmmmyboy Member

    Joined:
    Aug 26, 2013
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hey Michael,

    I appreciate you responding! I only just now saw this (must have notifications turned off here for some reason). Essentially we have to do a database call to get a unique customer ID from our billing system to match up with a piece of javascript we need to insert (we're using Intercom and the javascript embed requires that unique customer ID which currently only resides in our billing system's database). Never took a stab at building a plugin before but perhaps that's the best route. Or alternatively I may look into other ways to get that one piece of information for the embed without having to do a database call (have to think through what that might look like).
     
Loading...
Similar Threads - Calling MySQL database
  1. Erik Ellsinger
    Replies:
    7
    Views:
    380
  2. Ed.
    Replies:
    11
    Views:
    673

Share This Page