1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Call php file within a wordpress posts?

Discussion in 'Affiliate Programs' started by JJohn, Jan 5, 2010.

  1. JJohn

    JJohn Newbie

    Joined:
    Nov 2, 2009
    Messages:
    48
    Likes Received:
    5
    Im not sure if this is possible, to me it should be but I don't know how.
    I know there is a plugin that allows you to run php code within wordpress posts...but this is not what I want. I don't want a plugin, and I don't need to type php code in my posts.

    I have a php file like mycode.php on my server, and within certain wordpress posts, I just wanna call that file so it runs the php file...how do I do it? In the HTML view, can I just link in someway to that php file? Is what I am asking even possible?
     
  2. origin

    origin Regular Member

    Joined:
    Nov 11, 2008
    Messages:
    334
    Likes Received:
    90
    Home Page:
    Edit your theme, call it from there (before or after showing the posts).
     
  3. SpamHat

    SpamHat Junior Member Premium Member

    Joined:
    Apr 27, 2009
    Messages:
    151
    Likes Received:
    67
    Location:
    UK
    Use that plugin to run php code in your post.

    In your post do this:

    Code:
    <?php
    include '/path/to/script/to/run.php';
    ?>
    
     
  4. Guaji

    Guaji Regular Member

    Joined:
    May 28, 2009
    Messages:
    441
    Likes Received:
    226
  5. meannn

    meannn Supreme Member

    Joined:
    Apr 22, 2009
    Messages:
    1,461
    Likes Received:
    1,896
    Occupation:
    Unemployed Winner
    Location:
    TR
    Anybody knows how to do this in free wordpress blogs ?
     
  6. Megalomaniac Midget

    Megalomaniac Midget Power Member Premium Member

    Joined:
    Oct 1, 2009
    Messages:
    688
    Likes Received:
    1,063
    Occupation:
    Bullshit Artist
    Home Page:
    in the template
    PHP:
    <?php
    include '/public_html/phpscriptlocation/blahblahblah.php';
    ?>