Jump to content


Photo

include feature


  • Please log in to reply
4 replies to this topic

#1 foreverhex

foreverhex
  • Members
  • PipPipPip
  • Advanced Member
  • 91 posts

Posted 21 June 2006 - 12:04 AM

Is there any way to use the include php feature to read the files varibles and not the literal text. For example my file reads like this.

$file = "bleh.txt";
include '$file';

echo 'you are';
echo $bleh;

and bleh.txt

$bleh = "bleh";

I want it to come out "you are bleh" not "you are $bleh = "bleh";".
If that made any since, please help.

Ah! never mind! All I had to do is add <?php at the begining of txt file and rename the txt file php.

Ah! never mind! All I had to do is add <?php at the begining of txt file and rename the txt file php.

#2 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 21 June 2006 - 12:06 AM

test.php

include "test_result.php";
echo "<br>you are $bleh<br>";


test_result.php

$bleh = "bleh";

Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#3 foreverhex

foreverhex
  • Members
  • PipPipPip
  • Advanced Member
  • 91 posts

Posted 21 June 2006 - 12:09 AM

are the ( ) required? I never use them and everthing seems to be fine.

#4 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 21 June 2006 - 12:11 AM

[!--quoteo(post=386203:date=Jun 21 2006, 12:09 AM:name=foreverhex)--][div class=\'quotetop\']QUOTE(foreverhex @ Jun 21 2006, 12:09 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
are the ( ) required? I never use them and everthing seems to be fine.
[/quote]

sorry no ()

Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#5 steelmanronald06

steelmanronald06
  • Staff Alumni
  • Advanced Member
  • 2,004 posts
  • LocationOk

Posted 21 June 2006 - 12:12 AM

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

All of those will work.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users