Page 1 of 1

Help with include

Posted: Wed Apr 15, 2009 4:58 am
by JPM
Hi :lol:
I'm trying to use the include script dynamically
This is my code that does not work due to syntax error :?

Code: Select all

 
<?php
include (echo .$req_user_info['htmlpage'].);
?>
 
This is how it usaually looks like

Code: Select all

 
<?php
include (matrix_card.html);
?>
 
But I'm saving "matrix_card.html" in the user field "htmlpage" in the db
So I want the inlude to work Dynamically

the .$req_user_info function works I'm only trying to get the syntax right inside the bracket of the include (?)

Re: Help with include

Posted: Wed Apr 15, 2009 6:32 am
by marxJ
AFAIK you don't want the echo inside include. If $req_user_info['htmlpage'] == matrix_card.html (as I understand is the case), this should work fine:

Code: Select all

<?php
include ($req_user_info['htmlpage']);
?>

Re: Help with include

Posted: Wed Apr 15, 2009 2:07 pm
by socket1
Echo is only used to write output to the page that's being generated.