• OK. I’m stumped on this one. Hopefully somebody can shed some light on this.

    I am attempting to get a php site running in a page on my wordpress site.

    I got the site running correctly in a separate folder. Check it out here.

    https://www.freecookingvideos.com/recipepage

    I got as far as creating a stripped down page template and assigning it to that page. The site comes up but the path is incorrect. It keeps trying to use the blog path instead of the relative path. ie /freecookingvideos instead of /freecookingvideos/recipepage.

    I have tried putting the entire path in the config file of the php site and in wordpress. Nothing works. ??

    Maybe I just can’t do this without some plugin but it seems like a simple command somewhere is eluding me.

    here is the code in the page template I am using.
    <?php
    /*
    Template Name: Recipe
    */
    ?>

    <?php get_header(); ?>

    <?php $siteurl= ‘https://www.freecookingvideos.com/recipepage&#8217;; ?>
    <?php require (‘https://www.freecookingvideos.com/recipepage/index.php&#8217;); ?>

    <?php get_footer();

    The $siteurl line is probably useless, but it was worth a shot.

    I have even removed the header and footer and still the path stays the same.

    Well back to beating my head against the wall. ??

    here is the link to the blog page.

    https://www.freecookingvideos.com/recipes

Viewing 2 replies - 16 through 17 (of 17 total)
  • pmaior:
    Bloodhound: Try putting the url in parens like this
    <?PHP include ‘https://distinctivephoenix.com/Contrib.php&#8217;)?>

    Man… the very first thing told to you in this thread was this DOES NOT WORK. For somebody that allegedly knows “better” PHP the difference between an URI and a path should be clear.

    Bloodhound, do not use URI in include, only path. Read the whole thread and you will find examples for distinction.

    Thread Starter pmaior

    (@pmaior)

    Moshu:

    I was referring to the syntax only, not the contents. You are right I should have been more clear. I just copied the text he had in there.However , I did have success with that format as far as the file being included , it just did not work the way I expected, and I can see now that it never will.

    And I never claimed to be an expert, just competent. Like seeing that the parentheses were missing from a function call.

    Sorry for any confusion. I was just trying to be helpful. I will dispense with any further advice unless I have thoroughly tested it my self.

    Pablo

Viewing 2 replies - 16 through 17 (of 17 total)
  • The topic ‘include php on a page’ is closed to new replies.