@NightShift58Jan 23.2007 — #Simply add either index.php or index.html (or whichever is the default page for your server). Include code to redirect the visitors to where you want them to go or display a message saying "No,no...".
You can also prevent a directory listing by using .htaccess but the above is by far the simplest.
@NightShift58Jan 23.2007 — #Well, these two examples are a little bit different than hiding the exposed files. You actually want to not only expose them but publish the contents of the directory.
At a minimum, you'll need a database table where you can store all the additional information concerning the files in your tutorial directory.
Your table will need a few fields to describe each tutorial, such as file name, title, synopsis/description, perhaps tutorial date and author.
let's say, I have already put the titles in the title field of tutorial tablename and description or contents in the description field of tutorial tablename
to retrieve [code=php] $query = "select * from tutorial where title='$title', contents='$contents'; $result = MySql_query($query); while ($data = MySql_fetch_array ($result)){ echo $data[title] - $data[contents]; }... [/code]
I'm still new in php so I was just coding it as fast as I could, I may need to check the syntaxes.
If I use it with database then I don't think I would have any problem with not exposing a certain file from my folder.
at this instance, I'm not gonna use Database but I'm gonna use folder to store the files.
@NightShift58Jan 23.2007 — #[code=php]<?php // Do the database connection things
// To produce a listing of ll that's in your table, don't use WHERE.... $sql = "SELECT * FROM tutorial "; $qry = mysql_query($sql) or die("SQL Error: $sql<br>" . mysql_error());
while ($data = mysql_fetch_array($qry)){ echo "<hr />"; echo <span style='font-weight:bold'>$data['title']</span> . "<br />"; echo $data[contents] . "<br /"> } ?>[/code] If you put this page in your tutorials folder and called it "index.php" then your files will not be openly displayed and visitors will only see the listing made by the script.