Showing posts with label PHP. Show all posts
Showing posts with label PHP. Show all posts

Wednesday, May 18, 2016

How to show line break from textarea in php mail

Intorduction:
Normally we just get the textarea message filed and put in our Email function, but when Email receive the textarea message filed show as continue without any New Line / line brack /
, so in this atrical i will describe you the simple code to get correct format for the textarea message filed.

PHP Function:  nl2br() 
full Function we use:  nl2br(htmlspecialchars()

Saturday, February 20, 2016

How to disable directory browsing using .htaccess – Apache Web Server

Disable directory browsing using .htaccess:-

  • Open your .htacces file
  • Look for Options Indexes
  • If Options Indexes exists modify it to Options -Indexes or else add Options -Indexes as a new line
  • The directory browsing feature should be disable by now

Disable directory browsing using httpd.conf:-

  • Open your httpd.conf, normally it’s located at /usr/local/apache/conf or /etc/httpd.conf
  • Go to your own Virtual Host settings and look for “Options Indexes”
  • Change the Indexes to -Indexes if Option Indexes exists or else add the Options -Indexes line
  • Restart your apache web server.
  • The directory browsing feature should be disable by now

Disable directory browsing in CPanel Share Hosting enviroment:-

  • Login to your CPanel
  • Click on Index Manager
  • Directory will be list down. Click on the directory name which you want to disable the directory browsing
  • Select No Index and click Save
  • The directory browsing feature should be disable by now
Once you disable directory browsing, visitor will not able to browse your directory by accessing the directory directly (if there is no index.html file). This will protect your files from exposing to the public.