gibbo1715 Posted November 8, 2009 Share Posted November 8, 2009 All This is driving me nuts and im sure it sould be very easy Basically im running an index page that has in include to a page content.php What i want to do is hyperlink to the index page in the following way index.php?folderlocation and pass the variable folderlocation to the include file content.php so i can tell the index page what path to goto to get the contentsw of a folder on my server Im trying to do a photo gallery with text using iframes with content dynamically added based on the folder where the files are, in this case the folder is content, i.e. index.php?content heres my code, if someone can assist i will be very greatfull, appologies if its something relly simple, im new to php so still learning (slowly ) Thanks Gibbo Content file <?php $v1 = $_GET['variable1Name']; $handle = opendir('./content/'); while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { echo "<div class='contentdiv'><iframe SRC=\"$file\" width=\"100%\" height=\"100%\" frameborder=\"0\">If you can read this your browser does not support iframes.</iframe></div>"; echo CONTENT; } } closedir($handle); ?> my index file just has the include as follows <?php include("content.php"); ?> Link to comment https://forums.phpfreaks.com/topic/180765-passing-variable-from-an-indexphpmyfoldername/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.