Forums

Embed PHP script in Page (3 posts)

  1. rleon
    Member
    Posted 2 years ago #

    I am trying to redo a ticket broker website that I have in wordpress.
    I have 3rd party phpscripts but

    1. dont know where to put them in order for them to work.
    or
    dont understand where to put the code in order for it to work on the page.

    Here is the output of the script.

    http://test.rleon.net/php/ResultsTicket.php?evtid=1003529&event=New+York+Giants+Vs.+Washington+Redskins

    Now I would like to embed that in the page test.

    There are several scripts to generate the results. So I think they should all go somewhere within a wordpress directory.

    I have PHP Execution installed. And it works fine.

    I just cant seem to embed the phpscripts within the website test.rleon.net

  2. MichaelH
    Volunteer
    Posted 2 years ago #

    If the script is in my WordPress 'root' subfolder

    include(ABSPATH . 'myphp.php');

    And depending on where you want to put those scripts, there's also other variables, in place of ABSPATH, that you can use.
    Examples:
    WP_CONTENT_DIR
    WPINC
    WP_PLUGIN_DIR
    STYLESHEETPATH
    TEMPLATEPATH

    If your code doesn't require being in specifically named files, could also put the code in those scripts in your theme's function.php if that's of interest...

  3. rleon
    Member
    Posted 2 years ago #

    Maybe I am missing something but do i put

    include(ABSPATH . 'ResultsTicket.php?evtid=1003529&event=New+York+Giants+Vs.+Washington+Redskins');

    In the page?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.