4images Forum & Community
General / Allgemeines => Chit Chat => Topic started by: ID25 on August 13, 2005, 05:55:41 PM
-
i can include to the templates
ex: <?php echo("menu.php"); ?>
i know what in version 1.7 4images this not working, but on 1.7.1 this working ok :)
and no problem, what you say, there is ok at this version?
-
ok, are you having problem or what? what is your question? if u looking for an oppinion, then this topic is belong to chit-chat forum, if you are experiencing problem then please tell so.
otherwise look in the FAQ on how to properly include another .php file in the templates.
-
There is Discussion and topic is Discussion...
Discussion about:
or there is bug, or all ok in 1.7.1 version
May i can include <?php echo("file.php"); ?>
there is no problem on that version?
Why i must do this:
<?php
include($_SERVER['DOCUMENT_ROOT']."/images/file.php");
?>
if i can do this in simple mode <?php echo("file.php"); ?>
in 1.7.1 version
-
1) echo("file.php") will output file.php as a string and not content of the file.php file.
2) the point of the topic in FAQ is that u SHOULD NOT have anything on the same line with <?php and ?> and not about what kind of path must be used for the included file.
P.S. I'm moving this topic in Chit-Chat.
-
if i put echo("file.php") in home.html there is ok?
if in file.php just HTML code
maybe 4images faster work with this...
-
Maybe you don't understand me..
I want to make one file for menu and one for banner, why?
because if i change something in one file, in all templates and all pages this info will be changed
What i must do, that site work good and fast?
-
u dont use echo, u should use include()
-
ok, thank's
at now i understand that i must do this:
<?php
include($_SERVER['DOCUMENT_ROOT']."/images/file.php");
?>
and only this
in templates...
-
http://us3.php.net/manual/en/function.include.php
-
if i understand right, need do that? :
<?php
include($_SERVER['DOCUMENT_ROOT']."http://www.mysite.com/images/file.php");
?>
but if i want place this template in other site, need replace all this.... bad idea
--- --- ---
my english bad :/
-
I still don't understand why you wish to add a PHP file inside your images path.
It should, rather, go like this :
<?php
include($_SERVER['DOCUMENT_ROOT']."/file.php");
?>
That's all there is . . .
-
Because this php is in images category, not in root(www.mysite.com)
-
So ... the question comes again : Why does it have to be specificly in the images folder ?
-
because this is from 4images peace of template, 4images installed to "images" dir
why i must cycle all site?
where 4images, there all files for 4images...
all templates use this php from "images" dir
-
all templates use this php from "images" dir
False. PHP files are being executed from - either - the root path of 4images or from a subfolder outside the template path. ;)
-
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
-
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 :
<?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.
-
But.. i can write to menu.php only HTML codes? :)
-
No ... it's only for inclusion of the file ... nothing else. :?
-
when i change to
<?php
include($_SERVER['DOCUMENT_ROOT']."/menu.php");
?>
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..
-
it's only for inclusion of the file ... nothing else. :?
i can write this to the menu.php :
<?php
print "HTML codes";
?>
and all ok :) because this is php, yes?
-
That would not be the best choice but yes.
-
That would not be the best choice but yes.
maybe you know better choice for that?
-
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).
-
thank you for info