Jump to content

foo

New Members
  • Posts

    5
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

foo's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Originally I was using a .htaccess file in each directory that I wanted to password protect from list view. Then I read in the Apache documents that the server would take a performance hit because even one .htaccess file in a directory will cause the server to look in all directories for an .htaccess file. So I learned access to the directory listing could be controlled via the httpd.conf file by editing it as I've done below for each directory that I want to password protect. My question is; Do I have to list every directory that I want to password protect in it's own listing<Directory /> ? Or can I use a relative link somehow to have them all follow the same rule all at once? The folder at the 3rd level is named differently for each directory path from htdocs.But the folder at the 4th level is named identically the same within each subdirectory of that 3rd level. So the folder at the 4th level is always the same name. <Directory /> Options FollowSymLinks AllowOverride None # AllowOverride AuthConfig Order deny,allow Deny from all </Directory> #Will password protect the directory from list view <Directory C:/xampp/htdocs/1stLevelFolder/2ndLevelFolder/nonConstantDirNameEx4532_3rdLevel/4thLevelSameName> AllowOverride AuthConfig AuthType Basic AuthName "restricted area" AuthUserFile C:/xampp/htpasswdFile/.htpasswd require valid-user </Directory> #Will password protect the directory from list view <Directory C:/xampp/htdocs/1stLevelFolder/2ndLevelFolder/nonConstantDirNameEx6786_3rdLevel/4thLevelSameName> AllowOverride AuthConfig AuthType Basic AuthName "restricted area" AuthUserFile C:/xampp/htpasswdFile/.htpasswd require valid-user </Directory> I tried with just two slashes after 2ndLevelFolder: <Directory C:/xampp/htdocs/1stLevelFolder/2ndLevelFolder//4thLevelSameName> AllowOverride AuthConfig AuthType Basic AuthName "restricted area" AuthUserFile C:/xampp/htpasswdFile/.htpasswd require valid-user </Directory> I also tried an asterisk and a percent sign: <Directory C:/xampp/htdocs/1stLevelFolder/2ndLevelFolder/*/4thLevelSameName> AllowOverride AuthConfig AuthType Basic AuthName "restricted area" AuthUserFile C:/xampp/htpasswdFile/.htpasswd require valid-user </Directory> <Directory C:/xampp/htdocs/1stLevelFolder/2ndLevelFolder/%/4thLevelSameName> AllowOverride AuthConfig AuthType Basic AuthName "restricted area" AuthUserFile C:/xampp/htpasswdFile/.htpasswd require valid-user </Directory> Is there a way to do such a thing? Thank you in advance!
  2. Ok, so we can use this function to get the time and date and then display it in a format that we want specifically. That's the default without using any optional time/date. Then this same date function gives us an added functionality that if we wanted to, we could also find an amount of time between dates/times by including parameters into the optional part. int mktime ([ int $hour [, int $minute [, int $second [, int $month [, int $day [, int $year [, int $is_dst ]]]]]]] ) Returns the Unix timestamp corresponding to the arguments given. This timestamp is a long integer containing the number of seconds between the Unix Epoch (January 1 1970 00:00:00 GMT) and the time specified. There might be more uses, but that's what I see for now and that might be good enough to get me going again. I can almost see how the commas are coming into play after parameters and before optional elements if there are any, to separate those optional elements from the original parameter. Thanks so much for the thorough explanations. I appreciate them very much. I wanted to make sure I had a better understanding before going any further with the book. On to the next chapter. =)
  3. Thank you. That answered a lot for me. By the way, I love your music playlist php script. Very cool indeed. Ok so let me run through some of the examples to make sure I get this: echo date("l"); print the date(/*return in the format of l*/ "l"); //which is how we format the date if we want to know the day of the week. //l = A full textual representation of the day of the week = Sunday through Saturday /*we didn't supply a specific date/timestamp so because of the optional, the code chooses our current date and inputs into the paramater area which is denoted with [ ] because that means this is an optional parameter placement for the function.*/ #So in that example we only formatted today's date and printed it. (Not tested) So, if I want the day of the month: echo date("d"); If I wanted the day and the week: echo date("d,W"); Day, Week, Month: echo date("d,W, F"); Seem right? Ok, so those are when we don't supply a particular date. But what about when we do. Is this an example of that? // Prints: July 1, 2000 is on a Saturday echo "July 1, 2000 is on a " . date("l", mktime(0, 0, 0, 7, 1, 2000)); Why does this example include mktime instead of just being: // Prints: July 1, 2000 is on a Saturday echo "July 1, 2000 is on a " . date("l", (7, 1, 2000)); I am still confused by the comma in: string date ( string $format [, int $timestamp] ) See how the comma is inside the optional but in the previous example the comma is outside the optional? Thanks so much for taking the time out to explain these features of the language. It is very interesting and mind boggling at the same time.
  4. Ok, so when I see date() I see that the () means that it could return something. Argument called format, how do I see this argument to know what it does? I am guessing it's a function on its own that changes what it returns as well, yes? http://www.php.net/date doesn't show the inner workings of format. Is this something I can just disregard? Do I need to know what the format function looks like? I don't understand this. At the manual's page: http://www.php.net/date it says that format itself is a parameter. Where does timestamp come from? That's used throughout the PHP manual found at www.php.net/manual
  5. echo date('j F Y'); Ok, I think I understand what is happening above. It says print this date in this particular format with day, month, year in that particular order. But now the book Sams Teach Yourself PHP in 10 minutes a day shows the following example for its explanation. string date (string format [, int timestamp]) I'd quote the book but I don't know if that's ok to do so. I don't understand what is happening with this particular function. Maybe this is a bad example for the book to begin with to explain how functions work. date is a string object I take it? And inside this object you can have something maybe? I am not sure what though, is it just one thing, is it two things? It really looks as if it's saying format something that's inside of the [ ] to a string format. I am guessing because it looks like there maybe a different format inside the [ ]. But, but there's a comma all by its lonesome on the left hand-side inside the brackets. What in the world happened there? Thanks in advance for any info.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.