• Resolved seank123

    (@seank123)


    I am trying to create a button that triggers downloaded file filled with content from a PODS post type.

    I have the following that downloads a txt file when a HTML button is click:

    <?php //Generate text file on the fly
    
    header("Content-type: text/plain");
    header("Content-Disposition: attachment; filename=savethis.txt");
     
    // do your Db stuff here to get the content into $content
    print "This is some text...\
    ";
    print $content;
    ?> 

    But when I try to add something like $staff_social = pods(‘staff_member’, get_the_id()); I get an error:
    Uncaught Error: Call to undefined function pods()

    Is it possible to get PODS data with an external PHP file like this?

    THanks

Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘External PHP file to create a downloadable text file’ is closed to new replies.