gradinafrica
New member
I have some code:
<?php
session_start();
if ($_GET['site'])
{
$posted = true;
$index = glob("" . $_GET['site'] . "/*.php");
}
?>
<form action="indexer.php" method="GET">
<input type="text" name="site" />
<br />
<input type="submit" value="Index!" />
</form>
<br />
<?php
if ($index)
{
echo "Index:<br /><br />";
foreach($index as $file)
{
echo $file . "<br />";
}
}else if ($posted)
echo "No index returned!"
?>
What I designed this code to do is to return a list of all files in a web server directory. Obviously as you can see above, this code would scan for php files, but I was going to later add another input that would allow me to specify the file type to scan.
The only thing is, this code will work for directories on the server on which this code is located, while if I type in a full URL into the existing input (even a URL of the server it is located on), the php.ini file blocks access. I am trying to get around this somehow so that I can type in a URL and be given a list of the files in that directory. Enlighten me.
<?php
session_start();
if ($_GET['site'])
{
$posted = true;
$index = glob("" . $_GET['site'] . "/*.php");
}
?>
<form action="indexer.php" method="GET">
<input type="text" name="site" />
<br />
<input type="submit" value="Index!" />
</form>
<br />
<?php
if ($index)
{
echo "Index:<br /><br />";
foreach($index as $file)
{
echo $file . "<br />";
}
}else if ($posted)
echo "No index returned!"
?>
What I designed this code to do is to return a list of all files in a web server directory. Obviously as you can see above, this code would scan for php files, but I was going to later add another input that would allow me to specify the file type to scan.
The only thing is, this code will work for directories on the server on which this code is located, while if I type in a full URL into the existing input (even a URL of the server it is located on), the php.ini file blocks access. I am trying to get around this somehow so that I can type in a URL and be given a list of the files in that directory. Enlighten me.