Hey there, Awesome Customers!

Just a heads up: We'll be taking a breather to celebrate International Workers' Day (May 1st and 2nd - Wednesday and Thursday) and Orthodox Easter from Good Friday (May 3rd) through Easter Monday (May 6th). So, from May 1st to May 6th, our team will be off enjoying some well-deserved downtime.

During this time, our customer support will be running on a smaller crew, but don't worry! We'll still be around to help with any urgent matters, though it might take us a bit longer than usual to get back to you.

We'll be back in action at full throttle on May 7th (Tuesday), ready to tackle your questions and requests with gusto!

In the meantime, you can explore our documentation for Amelia and wpDataTables. You'll find loads of helpful resources, including articles and handy video tutorials on YouTube (Amelia's YouTube Channel and wpDataTables' YouTube Channel). These gems might just have the answers you're looking for while we're kicking back.

Thanks a bunch for your understanding and support!

Catch you on the flip side!

Warm regards,

TMS

Okay
  Public Ticket #1512255
Secure Data & Dynamic Parameter Requirement
Closed

Comments

  • Mycreativewebsols started the conversation

    Hello,

    I have 2 major issues with the plugin utilizing the PHP serialized array method:

    1. Dynamic parameter requirement - I need ability to use $_SESSION or get_option with $_SERVER['REMOTE_ADDR'] to use a user id in order to output results.. Both of these works fine when I directly access the URL but wpdatatable says no data found for table. How exactly wpdatatable pull results from php serialized array url? using php CURL method?

    USAGE EXAMPLE:- I want to pull employee list of a company using its COMPANY ID stored in session or get_option($_SERVER['REMOTE_ADDR'])

    2. Secure data handling - I would like to use is_user_logged_in() function of wordpress before outputing the php serialized array output. This works totally fine when i access the url directly  but wpdatatable always return NO results as  it may not contain wordpress authentication cookie in its request. is_user_logged_in() is always FALSE and wont return any results in wpdatatable even if user is logged in and serialized results can be found by directly accessing  the url.

    How to achieve these 2 goals.. Does the wpdatatable wont even send the $_SERVER['REMOTE_ADDR'] or any server headers, wp login cookies, sessions?? If atleast wp_get_current_user() could work, I can handle both the requirements somehow..

  • Mycreativewebsols replied

    Time is Money $ :) Resolved it myself.. All you need to add is 

    curl_setopt($ch, CURLOPT_COOKIE, $_SERVER['HTTP_COOKIE']);

    at Line 157 of source/class.wdttools.php file during Curl request. This way is_user_logged_in() authentication can be done at remote end i.e., php serialized array URL in this case.


    Cheers,

    ~Vijay

  •  1,692
    Miloš replied

    HI Vijay,
    Thank you for your purchase.


    Yes we are using PHP CURL method but in some cases there is a probability that you will need to add some certificate to the plugin file ( depends on your certificate verification)  You can find more information on this link. So for your this line of code 

    curl_setopt($ch, CURLOPT_COOKIE, $_SERVER['HTTP_COOKIE']);

    will do the trick.


    Nevertheless glad to hear that you found the solution, good job.

    If you have any more issues feel free to open a new ticket, we will gladly help.


    Best regards.

    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables