Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Join Date
    Aug 2008
    Posts
    20
    Plugin Contributions
    0

    Default PHP requires or include

    I need some PHP help please?!

    I've got a page (or rather a news page) I need to display on my homepage. I've done a little test to see if I can bring a test page in from my Common folder and it worked, the code was as follows: <?php require($template->get_template_dir('test.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/test.php');?>

    The page in question is called shownews.php and needs to come from a folder called Freshlypeeled on the top level of the website.

    Thanks in advance

  2. #2
    Join Date
    Apr 2004
    Location
    UK
    Posts
    5,821
    Plugin Contributions
    2

    Default Re: PHP requires or include

    Try adding code to define_main_page.php via
    zencart admin..

  3. #3
    Join Date
    Aug 2008
    Posts
    20
    Plugin Contributions
    0

    Default Re: PHP requires or include

    I've added the code to define_main_page.php and it works fine but what I need to know is what bits of code do I need to change (in the following line of code - <?php require($template->get_template_dir('test.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/test.php');?>)

    in order to get my page called shownews.php to display on the main page? Sorry if I'm not making much sense but it's confusing me?!

  4. #4
    Join Date
    Apr 2004
    Location
    UK
    Posts
    5,821
    Plugin Contributions
    2

    Default Re: PHP requires or include

    Depends what is url of your zencart website...
    so that paths are correct for calling php file required.

  5. #5
    Join Date
    Aug 2008
    Posts
    20
    Plugin Contributions
    0

    Default Re: PHP requires or include


  6. #6
    Join Date
    Apr 2004
    Location
    UK
    Posts
    5,821
    Plugin Contributions
    2

    Default Re: PHP requires or include

    And what is EXACT url of php page you wish to show?

  7. #7
    Join Date
    Aug 2008
    Posts
    20
    Plugin Contributions
    0

    Default Re: PHP requires or include


  8. #8
    Join Date
    Apr 2004
    Location
    UK
    Posts
    5,821
    Plugin Contributions
    2

    Default Re: PHP requires or include

    Quote Originally Posted by andytho View Post
    Page link you have supplied is not valid/unobtainable.

  9. #9
    Join Date
    Aug 2008
    Posts
    20
    Plugin Contributions
    0

    Default Re: PHP requires or include

    Hi, you can' t actually view the page link but it can be viewed when I put it in some PHP includes tags, this is definitely the link I need to bring in to my homepage though.

    The link I posted previously ../shownews.php is created from a little PHP news program called Cute News.

  10. #10
    Join Date
    Aug 2008
    Posts
    20
    Plugin Contributions
    0

    Default Re: PHP requires or include

    Hi again, I've uploaded an example so that you can view the news page - www.peelerboardwear.co.uk/freshlypeeled/example1.php

    This is where the news needs to come from for the home page. Please can you supply the code I need to insert it into my main page?

    Cheers,
    Andy

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 4
    Last Post: 29 May 2016, 03:32 PM
  2. Replies: 2
    Last Post: 16 Oct 2011, 11:27 PM
  3. Include a custom php file in mainpage.php
    By BeautyHealth.com.cy in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 8 Nov 2010, 02:45 PM
  4. Php include
    By ericsc in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 26 May 2009, 05:32 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg