I found the easiest solution for listing directories and files on my server. Please take a look below:
<?
$dir = “images/”; //You could add a $_GET to change the directory
$files = scandir($dir);
foreach($files as $key => $value){
echo $value; //You could add an icon in here maybe, a link to the file/directory, or a link to list files [...]
How do I rewrite non-https to HTTPS? The easiest solution is by entering 2 simple lines into your .htaccess.
See below:
RewriteCond %{HTTPS} !=on
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
There are a lot of times when you want to redirect your users from page1 to page2.
You can simply do that by enring few lines into .htaccess. Here is an example.
Let’s say, you don’t want your visitors to see you working on the website. Instead you would like to show them a page telling that [...]
I want to share this very simple trick which might help you to present errors in a user firendly pages.
Let’s say, user by accident types your page name incorrectly. Istead of showing typical “Page Cannot be Found” error, let’s do something quick but nice.
Open your .htaccess file (it’s ussually located on your root folder) and [...]
Sending e-mail from php should be very easy. Here is how I do it:
<?php
//define the receiver of the email
$to = ‘youraddress@example.com’;
//define the subject of the email
$subject = ‘Test email’;
//define the message to be sent. Each line should be separated with \n
$message = “Hello World!\n\nThis is my first mail.”;
//define the headers we want passed. Note that they are separated with [...]

