Help with include

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
JPM
Forum Newbie
Posts: 1
Joined: Wed Apr 15, 2009 4:41 am

Help with include

Post 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 (?)
marxJ
Forum Newbie
Posts: 2
Joined: Wed Apr 15, 2009 6:25 am

Re: Help with include

Post 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']);
?>
socket1
Forum Commoner
Posts: 82
Joined: Mon Dec 08, 2008 7:40 pm
Location: Shokan, New York

Re: Help with include

Post by socket1 »

Echo is only used to write output to the page that's being generated.
Post Reply