FRIHOSTFORUMSSEARCHFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

PHP include code problem

 


devroom
I use some template sytem and the text is included this way;

$text = "blabla blal bla bla"

Now is the problem that i want some php included.
but $text = "blabla blal bla bla <?php include (\"include_this.php\") ?>"
doesnt work

I ve also tried the following:
$text = "blabla blal bla bla include (\"include_this.php\") "
because im alread in a the php code. but it doenst work either

edit: ive made some layout. In the layout file stands <? write "$text" ?>
In the text file is the folling code include ('layout.php').
and $text = "blablalblalblalalb"

Now i want in the $text a php include. but
$text = "blablalblalblalbla
<?php include ('includephp') ?>
blablalblalblalbla"
doenst works

Hope now u people understand what i mean Very Happy

Ps. i include the text with <?php write "$text" ?>


Last edited by devroom on Wed Jan 04, 2006 4:07 pm; edited 2 times in total
Arin
In the include_this.php file write this:
Code:
<?

$inclusion="text to iclude";

?>

In the file referring to include_this.php write this:
Code:
<?

include 'include_this.php';

$text = "blabla blal bla bla".$inclusion;

?>


I didnt unterstand what you want to get, so if this wont work describe your problem with more detailed info.

cheers,
Arin.
dandelion
Another attempt to understand what you want. Smile

If your include_this.php file contains HTML code only, you can get its contents with the file_get_contents() function. Please see code below.
Code:
<?php
    $text = 'blabla blal bla bla';
    $contents = file_get_contents('include_this.php');
    print $text.$contents;
?>
Daniel15
devroom wrote:
I use some template sytem and the text is included this way;

$text = "blabla blal bla bla"

Now is the problem that i want some php included.
but $text = "blabla blal bla bla <?php include (\"include_this.php\") ?>"
doesnt work

I ve also tried the following:
$text = "blabla blal bla bla include (\"include_this.php\") "
because im alread in a the php code. but it doenst work either

edit: ive made some layout. In the layout file stands <? write "$text" ?>
In the text file is the folling code include ('layout.php').
and $text = "blablalblalblalalb"

Now i want in the $text a php include. but
$text = ""blablalblalblalbla <?php include ('includephp') ?>"
doenst works

Hope now u people understand what i mean Very Happy

Ps. i include the text with <?php write "$text" ?>


What you want to do is:
Code:

<?php
$text = "The text goes here";
include "layout.php";
?>
Sephz0r
<? php $text ; include("include.php"); ?>

You don't need the \ and the /
foumpie
$text = "blabla blal bla bla"

Now is the problem that i want some php included.
but $text = "blabla blal bla bla <?php include (\"include_this.php\") ?>"
doesnt work
-------------------------------------

oyu define $text = "blabla blal bla bla" ;

then you say
$text = "blabla blal bla bla <?php include ("include_this.php") ?>"

Problem 1
$text = "blabla blal bla bla <?php include ("include_this.php") ?>"
if you are using $text you PHP is already opened, no need opening twice !!

Good
$text = "blabla blal bla bla" . include 'include_this.php';

Better
$text = "blabla blal bla bla";
$text .= include "include_this.php";
(although not sure if this will work Smile )

[ NO / \ ]
Related topics

Displaying A Default Page Not Found.
PHP Include
Help needed with images in php include files
Do we support php include and/or SSI?
Brett Tabke's website tutorial

Web Protect
My Personal Site
ALL OF MY FRIH$ (over 200!!) for wordpress integration!!
.html using header/footer include script?
PHP Problem...

PHP Whos Online Code OR Page refresh..
include() Problem
problem with IE and "include"
PHP login script problem
Strange Problem in PHP-MYSQL
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.