I want to write a PHP script that will search for a variable in the string. If it's not found I want the code to ignore the variable code.
<?php
// get string variable
if ((strlen($_GET['name']))>4) {
$name = $_GET['name'];
echo $name;
echo "<br>";
}
//define the path as relative
$path = "/web/apache2/htdocs/intranet";
//using the opendir function
$dir_handle = @opendir($path) or die("Unable to open $path");
echo "Directory Listing of $path<BR>";
//running the while loop
while ($file = readdir($dir_handle)) {
echo "<a href='file:///d:/$path/$file'>$file</a><br>";
}
//closing the directory
closedir($dir_handle);
?>
I don't want to get errors if the "name=" isn't at the end of the filename.