Author Topic: include to the templates no problem in 1.7.1  (Read 27966 times)

0 Members and 1 Guest are viewing this topic.

Offline ID25

  • Full Member
  • ***
  • Posts: 125
    • View Profile
Re: include to the templates no problem in 1.7.1
« Reply #15 on: August 15, 2005, 10:11:58 PM »
but.. how i must to do that?
there is all working with no problem..

www.mysite.com/images/ --> my site
www.mysite.com/images/templates/default/ --> my template

if i want include menu(menu.php) to the "home.html", "details.html", "top.html" and etc
what i must to do?

BIG thank's for the help, i new with PHP

TheOracle

  • Guest
Re: include to the templates no problem in 1.7.1
« Reply #16 on: August 15, 2005, 10:21:18 PM »
Quote

if i want include menu(menu.php) to the "home.html", "details.html", "top.html" and etc
what i must to do?


All you need to do is to upload your menu.php file into your root folder of 4images. Then, from your HTML files, simply apply the following command on where you ' wish ' to add your included PHP file :

Code: [Select]

<?php

include($_SERVER['DOCUMENT_ROOT']."/menu.php");

?>



That easy . . .

and make sure you have the PHP execution code to 1 from your includes/constants.php file.

Offline ID25

  • Full Member
  • ***
  • Posts: 125
    • View Profile
Re: include to the templates no problem in 1.7.1
« Reply #17 on: August 15, 2005, 10:24:42 PM »
But.. i can write to menu.php only HTML codes? :)

TheOracle

  • Guest
Re: include to the templates no problem in 1.7.1
« Reply #18 on: August 15, 2005, 10:25:44 PM »
No ... it's only for inclusion of the file ... nothing else.  :?

Offline ID25

  • Full Member
  • ***
  • Posts: 125
    • View Profile
Re: include to the templates no problem in 1.7.1
« Reply #19 on: August 15, 2005, 10:31:37 PM »
when i change to
<?php
 include($_SERVER['DOCUMENT_ROOT']."/menu.php");
 ?>

Quote
Warning: Failed opening 'C:/serv/www/menu.php' for inclusion (include_path='.;c:\php4\pear') in C:\serv\www\images\includes\template.php(133) : eval()'d code on line 106

Warning: Failed opening 'C:/serv/www/my_footer.php' for inclusion (include_path='.;c:\php4\pear') in C:\serv\www\images\includes\template.php(133) : eval()'d code on line 1158

with "images/menu.php" this works good
because in this file only HTML ? or what..

Offline ID25

  • Full Member
  • ***
  • Posts: 125
    • View Profile
Re: include to the templates no problem in 1.7.1
« Reply #20 on: August 15, 2005, 10:36:58 PM »
it's only for inclusion of the file ... nothing else.  :?
i can write this to the menu.php :
Quote
<?php
print "HTML codes";
?>
and all ok :) because this is php, yes?

TheOracle

  • Guest
Re: include to the templates no problem in 1.7.1
« Reply #21 on: August 15, 2005, 10:48:29 PM »
That would not be the best choice but yes.

Offline ID25

  • Full Member
  • ***
  • Posts: 125
    • View Profile
Re: include to the templates no problem in 1.7.1
« Reply #22 on: August 15, 2005, 10:57:43 PM »
That would not be the best choice but yes.
maybe you know better choice for that?

TheOracle

  • Guest
Re: include to the templates no problem in 1.7.1
« Reply #23 on: August 15, 2005, 11:03:20 PM »
Yes, it you intend to code on PHP language and planning to execute of part of it on your HTML templates, I'd - rather - recommend to initial some tags then parse your template from a PHP file (which is far more efficient and secured in this case).

Offline ID25

  • Full Member
  • ***
  • Posts: 125
    • View Profile
Re: include to the templates no problem in 1.7.1
« Reply #24 on: August 15, 2005, 11:17:42 PM »
thank you for info