0

I have the name of a php file stored in the database and i need to call that name and display that file on the current page. The code below tries to display a page called "$lay"

<?

$q = "select layout from HomeUser where username = '$username'";
$lay = mysql_query($q,$conn);

require_once '$lay';

?>
1
Contributor
1
Reply
2
Views
7 Years
Discussion Span
Last Post by roostr
0

i solved the problem with the following code

<?

$user = $_SESSION['username'];
$q = "select layout from HomeUser where username = '$user'";
$lay = mysql_query($q);

while ($row = mysql_fetch_array($lay)) { 

require_once $row[layout]; 

}

?>
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.