I'm trying to select the name of a page from a php while loop (listing the contents of a directory) and pass it through the browser. Here's the code:
PHP Code:
$dir = opendir('pages/');
while($read = readdir( $dir )) {
if (substr($read,0,1)=='2') {
echo '• <a href="reviewpages.php?id=$read" target="_self">';
echo $read . '</a><br />';
}
}
closedir($dir);
All the above code does is literally send the characters '$read' through the browser - it doesn't seem to pick up the individual name of the page. Has some kind person out there go any ideas?