Results 1 to 7 of 7
  1. #1
    Join Date
    Nov 2009
    Posts
    34
    Plugin Contributions
    0

    help question Include a custom php file in mainpage.php

    now this is a whole new php file, all the coding is in that file, php file which echo html back.

    you can see this in operation here : http://www.beautyhealth.com.cy/testgal8.php

    Now i want to show that output on my main page through that php file....

    How can i do that?

    i have tried to add this code
    PHP Code:
    <?php
    include("testgal7.php");
    ?>
    in my mainpage via the define pages admin but at soon as it reached that line the rest was blank....

    PLEASE SOMEONE HELP

  2. #2
    Join Date
    Nov 2009
    Posts
    34
    Plugin Contributions
    0

    Default Re: Include a custom php file in mainpage.php

    The php file that i want to include is attached
    Attached Files Attached Files

  3. #3
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Include a custom php file in mainpage.php

    What error message did you get in your /cache/ folder? Look for the latest myDEBUGxxxxxxxxxxxxxxxx.log file there.

  4. #4
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Include a custom php file in mainpage.php

    Your file has

    require('includes/application_top.php');

    which I don't think should be done for a file in the middle of page processing.

    There is also a typo in line 45:
    echo "<td aligh='top'>

  5. #5
    Join Date
    Nov 2009
    Posts
    34
    Plugin Contributions
    0

    Default Re: Include a custom php file in mainpage.php

    Quote Originally Posted by gjh42 View Post
    What error message did you get in your /cache/ folder? Look for the latest myDEBUGxxxxxxxxxxxxxxxx.log file there.

    There is nothing in my cache folder.


    Quote Originally Posted by gjh42 View Post
    Your file has

    require('includes/application_top.php');

    which I don't think should be done for a file in the middle of page processing.

    There is also a typo in line 45:
    echo "<td aligh='top'>
    Ok, i have fixed the typo.
    Just removing the require('includes/application_top.php'); should work ?
    I thought that require('includes/application_top.php'); was enebling me to send sql queries to my db

  6. #6
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Include a custom php file in mainpage.php

    It needs to be required, but that happens in the Zen Cart code that builds the page to start with. It may disturb things to have it required again.

  7. #7
    Join Date
    Nov 2009
    Posts
    34
    Plugin Contributions
    0

    Default Re: Include a custom php file in mainpage.php

    That's done the work, removed the

    PHP Code:
    require('includes/application_top.php'); 
    and worked !

    THANKS A MILLION !!!

 

 

Similar Threads

  1. Can't include catalog functions in seperate PHP file.
    By fawad123 in forum General Questions
    Replies: 38
    Last Post: 6 Dec 2017, 07:59 PM
  2. 'include' php file
    By vandiermen in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 6 Sep 2011, 05:41 PM
  3. html header php file not in my custom template?
    By Hamilton33 in forum General Questions
    Replies: 5
    Last Post: 14 Jul 2011, 09:09 AM
  4. I cant get the php include statement to work in the tpl_header file.
    By buxton1 in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 23 Oct 2009, 12:16 AM
  5. How can I include a php file in the header section?
    By Andy_R in forum General Questions
    Replies: 3
    Last Post: 11 Sep 2009, 05:50 PM

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