When a web browser is pointed to a directory on your web site which does not have an index.html file (or any other index file) in it, the files in that directory can be listed on a web page.
Let us see few snippets that can be added in htaccess file to allow or avoid directory listing in apache server.

Enable / Disable directory Listing

To allow a web server to produce a directory listing, whenever you point a directory without index file. Add following line in your .htaccess file.
Options +Indexes
# or #
IndexIgnore *
allow-directory-listing-htaccess
To disable or prevent the directory access add following line in your .htaccess file. If user points the browsers to a directory which does not have index file then in this case 403 error will be
Options -Indexes
Following is the error page that gets displayed when we try to access any directory without index file.
403-directory-listing-error-htaccess

Change Listing style

You may want to display other details while showing the directory listing. This includes file icons, file size, modification date and more. This can be done by adding fancy style to your htaccess file. Add following snippet in .htaccess file.
IndexOptions +FancyIndexing
fancy-directory-listing-htaccess
To remove the fancy directory listing or to display normal directory listing, use -FancyIndex.
IndexOptions -FancyIndexing

Ignore files with specific extension

It may happen that you may need to ignore certain files to get displayed in directory listing. This can be achieved using IndexIgnore directive in .htaccess file.
Following snippet will not display .zip and .txt file in directory listing.
IndexIgnore *.zip *.txt

Modify Index File

It is possible to change the default index file from index.html (index.php, index.jsp …) to any other file. Following line will change the index file to Home.html.
DirectoryIndex Home.html

Learn Allow, Deny, Disable, Enable Directory Listing In .Htaccess

Unknown Reply 9:01 PM

When a web browser is pointed to a directory on your web site which does not have an index.html file (or any other index file) in it, the f...

That is Error Handling.

The @ is error suppression operator in PHP.
PHP supports one error control operator: the at sign (@). When prepended to an expression in PHP, any error messages that might be generated by that expression will be ignored.
See:

Update:

In your example, it is used before the variable name to avoid the E_NOTICE error there. If in $_POSTarray, hn key is not set, it will throwE_NOTICE message but @ is used there to avoid that E_NOTICE.
Note that you can also put this line on top of your script to avoid E_NOTICE error:
error_reporting(E_ALL ^ E_NOTICE);

PHP6 Note:

Because @ operator is very slow, it won't work on ini_set eg @ini_set.
You should avoid using it where you can.
Source : http://stackoverflow.com/questions/3551527/php-at-symbol-before-variable-name-post

What function of @ in PHP ???

Unknown Reply 11:00 AM

That is Error Handling. The  @  is error suppression operator in PHP. PHP supports one error control operator: the at sign (@). When pre...

THis document will tel you how to unprotect an excel spread sheet without having the password


In case of a password protect worksheet you are unable to Edit the data on the Excel Sheet. If you do not Remember the Password or do not know the password to unprotect the sheet just follow the below simple steps.
excel1
Press ALT +  F11 or click on View Code in Developers Tabs
 Excel2
In the Above White Space Enter the below Code. Do not change the code just copy paste:
Sub PasswordBreaker()
    'Breaks worksheet password protection.
    Dim i As Integer, j As Integer, k As Integer
    Dim l As Integer, m As Integer, n As Integer
    Dim i1 As Integer, i2 As Integer, i3 As Integer
    Dim i4 As Integer, i5 As Integer, i6 As Integer
    On Error Resume Next
    For i = 65 To 66: For j = 65 To 66: For k = 65 To 66
    For l = 65 To 66: For m = 65 To 66: For i1 = 65 To 66
    For i2 = 65 To 66: For i3 = 65 To 66: For i4 = 65 To 66
    For i5 = 65 To 66: For i6 = 65 To 66: For n = 32 To 126
    ActiveSheet.Unprotect Chr(i) & Chr(j) & Chr(k) & _
        Chr(l) & Chr(m) & Chr(i1) & Chr(i2) & Chr(i3) & _
        Chr(i4) & Chr(i5) & Chr(i6) & Chr(n)
    If ActiveSheet.ProtectContents = False Then
        MsgBox "One usable password is " & Chr(i) & Chr(j) & _
            Chr(k) & Chr(l) & Chr(m) & Chr(i1) & Chr(i2) & _
            Chr(i3) & Chr(i4) & Chr(i5) & Chr(i6) & Chr(n)
         Exit Sub
    End If
    Next: Next: Next: Next: Next: Next
    Next: Next: Next: Next: Next: Next
End Sub
Now Click on the Run Button or press F5:
 Excel3

And there you go the sheet is unprotected for you now. Also you would be getting a message in the pop up window.
This Message is contains the password which can be used to unprotect the other sheets in the same workbook.
 Excel4

How to Unprotect an excel sheet without password

Unknown Reply 4:39 PM

THis document will tel you how to unprotect an excel spread sheet without having the password In case of a password protect worksheet y...

I recently stumbled upon the following issue – I had an associative array with key=>value type and I wanted to get the value of a specific key. I wasn’t able to find a suitable built-in PHP function, so I decided to write something of my own. Feel free to reuse it however you like.
Include this function anywhere in your PHP file:
function find_by_key($searched, $array){
 if(!is_array($array)) return FALSE; // We haven't passed a valid array
 
 foreach($array as $key=>$value){
  if($key==$searched) return $value; // Match found, return value
 }
 return FALSE; // Nothing was found
}
Then you can use it by following this example:
$sample_array = array(
 'bmw'=>'fast',
 'mercedes'=>'luxury',
 'audi'=>'expensive'
);
 
echo find_by_key('audi', $sample_array);
This example should output ‘expensive’. I hope you find this useful.
source : http://ephp.info/get-by-key-associative-array

Find Value Of Key In Associative Array

Unknown Reply 11:53 AM

I recently stumbled upon the following issue – I had an associative array with key=>value type and I wanted to get the value of a specif...

I have an array:
$array = (apple, orange, strawberry, blueberry, kiwi);
the user enters strawberry
strawberry is removed.

Use array_search to get the key and remove it with unset if found:
if (($key = array_search('strawberry', $array)) !== false) {
    unset($array[$key]);
}
array_search returns false (null until PHP 4.2.0) if no item has been found.
And if there can be multiple items with the same value, you can use array_keys to get the keys to all items:
foreach (array_keys($array, 'strawberry') as $key) {
    unset($array[$key]);
}

How to remove specific element from an array PHP

Unknown Reply 6:40 AM

I have an array: $array = ( apple , orange , strawberry , blueberry , kiwi ); the user enters  strawberry strawberry  is removed....

Perbedaan Program Java, C#, PHP dalam OOP

Unknown Reply 11:46 AM

PATTERN MEDIATOR DI JAVA, C# DAN PHP Setelah update tentang pattern  observer , langsung ane terusin update juga design pattern...

Search

Ikuti Channel Youtube Aku Yaa.. Jangan Lupa di subscribe. Terima kasih.

Popular Posts

Translate