newbtophp Posted August 28, 2009 Share Posted August 28, 2009 I have a variable: $rootpath = $_SERVER["SCRIPT_FILENAME"]; include '$rootpath/templates/header.php'; How would i place the variable in the include?, the way im doing it, is currently giving me errors. Thanks Link to comment https://forums.phpfreaks.com/topic/172220-variable-in-include/ Share on other sites More sharing options...
trq Posted August 28, 2009 Share Posted August 28, 2009 Variables are not interpolated within single quotes. So... include "$rootpath/templates/header.php"; or.... include $rootpath . '/templates/header.php'; Link to comment https://forums.phpfreaks.com/topic/172220-variable-in-include/#findComment-908024 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.